Skip to content

Disable ctrl+d with specific window title #9581

Closed Answered by faho
benni347 asked this question in Q&A
Discussion options

You must be logged in to vote

Fish doesn't know the window title and the escape sequence to get it from the terminal is, from what I can find, not well-supported because of security concerns (see e.g. VTE's code, which sends a fake static title).

I would recommend you find some other way to identify that window, like set your terminal to pass an environment variable.

For example, if a variable NO_EXIT was set:

bind \cd 'if set -q NO_EXIT; commandline -f delete-char; else; commandline -f delete-or-exit; end'

Or just set ctrl-d to delete-char and use exit manually:

bind \cd delete-char

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by benni347
Comment options

You must be logged in to vote
1 reply
@benni347
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants