macOS: fn+alt+del
doesn't delete next word although alt+del
deletes previous word
#4862
Unanswered
JakobEdding
asked this question in
Feature Requests, Ideas
Replies: 1 comment 2 replies
-
you probably just need to configure your shell with the correct keybindings. ie. in zsh/ghostty bindkey '\e[3;3~' kill-word Each terminal/shell is a bit different though, easiest way to figure out the codes for your setup is to use
Ultimately I ended up with something like this in my if [[ "$OSTYPE" == darwin* ]]; then
if [[ "$TERM_PROGRAM" == 'ghostty' ]]; then
bindkey '\e[1;3A' beginning-of-line # alt + up
bindkey '\e[1;3B' end-of-line # alt + down
bindkey '\e[3;3~' kill-word # alt + delete
elif [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]]; then
bindkey '\e^[OA' beginning-of-line # alt + up
bindkey '\e^[OB' end-of-line # alt + down
bindkey '\e(' kill-word # alt + delete
fi
fi |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Congrats on the v1 launch and thanks for the great alternative to existing terminal emulators!
With command line input
foo baz bar
and the cursor positioned afterz
,alt+del
will removebaz
so that the input is nowfoo bar
. This is what I would expect.However, with same input and cursor position,
fn+alt+del
will not removebar
but instead insert~
so that the input is nowfoo baz~ bar
. Is it possible to configure the behavior offn+alt+del
somehow so thatbar
will be removed and the resulting input isfoo baz
? This is a behavior I'm used to from iTerm 2 and would love to see in ghostty as well. [Edit: Doesn't seem to have anything to do with iTerm 2 but rather with macOS system-wide emacs shortcuts.]Beta Was this translation helpful? Give feedback.
All reactions