You are not logged in.
Pages: 1
ctrl d closes tabs in guake and xfce terminal. I cannot find where this shortcut key is defined so i can disable it. It messes up ranger which uses ctrl d to scroll down half a page. In xfce terminal i disabled access keys and shortcut keys. Im using mx linux and dont have the same issue with guake on ubuntu, so it is something with xfce i guess.
ctrl d works fine in vim in guake and xfce terminal, but in ranger it doesnt
Last edited by neverdimed (2022-07-09 20:29:48)
Offline
Ctrl+d is a bash setting that kills the interactive session. You can control the behaviour of this function with the environment variable:
export IGNOREEOF=3
...the value at the end will indicate the number of consecutive presses before bash acts on the close signal.
From "man bash":
IGNOREEOF
Controls the action of an interactive shell on receipt of an EOF
character as the sole input. If set, the value is the number of
consecutive EOF characters which must be typed as the first
characters on an input line before bash exits. If the variable
exists but does not have a numeric value, or has no value, the
default value is 10. If it does not exist, EOF signifies the
end of input to the shell.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
It's actually not bash-specific. It's defined in a terminal interface, regardless of the shell. A more shell-agnostic solution would be:
set -o ignoreeof
Put it in the ~/.profile and any Bourne-compatible login shell will pick it up (bash, dash, what have you). GNOME Terminal has this as a toggle. Considering Xfce terminal uses VTE, the same library GNOME Terminal is based on, this setting should also be exposed in the GUI, I think.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
bash supports it and may have even originated it. it's just not bash exclusive (at least not anymore). if you use bash, then you have bash do it. if you use a different shell, it may or may not be supported.
once something becomes a (de-facto) standard. it often gets used in a similar way in other places, either by the same name, or by the same mechanism, or both.
i don't use it and don't want it to end my shell if it gets pressed by accident. so i have:
export IGNOREEOF=32767
Last edited by Skaperen (2022-07-09 19:12:44)
Offline
many thanks for your responses. I ran both suggestions, but neither affected the behaviour in ranger. I thought it must be a ranger problem then and added this to my rc.conf:
copymap <PAGEDOWN> <C-D>
copymap <PAGEUP> <C-U>
works perfectly
ps, is it possible to check the value assigned to ingoreeof? when i ran your suggestions there was no output, it doesnt seem to recognise ignoreeof(?)
Last edited by neverdimed (2022-07-09 20:32:12)
Offline
Skaperen, like I already said, it's not a shell-specific thing. Just like pressing Enter isn't. Even csh has the ignoreeof setting and it's not even a descendant of the original Bourne shell. Control codes had been around long before bash or any other "shell" even existed. Any terminal, or terminal emulator in our world, sets up its attributes through the termios struct. See the ASCII table: man ascii. The EOT (end of transmission) character is 004, 4, 0x04 (oct, dec, hex). That's the ^D character (on the same line as the D character).
neverdimed, what's Ranger? Is that a terminal emulator?
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
ranger is a file manager for the terminal with vim-like key bindings
Offline
Ah, I think I understand what you're trying to do. Here's my suggestion.
Create an empty file in ~/bin. If that directory doesn't exist, create it too.
Open it in your favorite text editor and put these lines:
#!/bin/sh
# A simple wrapper to Ranger, to disable the ^D control character.
stty eof "" # disable it for the duration of Ranger
/absolute/path/to/ranger # you MUST point to the absolute pathname of its executable
stty eof "^D" # re-enable it after Ranger session is closed
Turn on the execution bit:
chmod +x ~/bin/ranger
Check if your ~/.profile is set to include ~/bin in the PATH variable. If it doesn't, append the following lines:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Source the file for the changes to apply to your current session:
. ~/.profile
Don't worry, ~/.profile is read every time your login shell starts up, so it should persistent from now on.
Try this and let us know how it goes.
Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please!
Offline
Pages: 1
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 553.55 KiB (Peak: 570.84 KiB) ]