From e07aefa6010716ccc51c745b8e0dde9598b58812 Mon Sep 17 00:00:00 2001 From: Michielvk <16121929+Michielvk@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:22:29 +0100 Subject: [PATCH] fix: zsh shell integration when `sudo` and `ssh` aliases are defined --- src/shell-integration/zsh/ghostty-integration | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shell-integration/zsh/ghostty-integration b/src/shell-integration/zsh/ghostty-integration index 4d872d025..b02c745f2 100644 --- a/src/shell-integration/zsh/ghostty-integration +++ b/src/shell-integration/zsh/ghostty-integration @@ -249,7 +249,7 @@ _ghostty_deferred_init() { # Sudo if [[ "$GHOSTTY_SHELL_FEATURES" == *"sudo"* ]] && [[ -n "$TERMINFO" ]]; then # Wrap `sudo` command to ensure Ghostty terminfo is preserved - sudo() { + function sudo() { builtin local sudo_has_sudoedit_flags="no" for arg in "$@"; do # Check if argument is '-e' or '--edit' (sudoedit flags) @@ -272,7 +272,7 @@ _ghostty_deferred_init() { # SSH Integration if [[ "$GHOSTTY_SHELL_FEATURES" == *ssh-* ]]; then - ssh() { + function ssh() { emulate -L zsh setopt local_options no_glob_subst