Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I run cat on gnome-terminal, both C-d and C-S-d terminate it. This is because gnome-terminal cannot distinguish between these keys and sends and EOF in both the cases. Is there a ways I can configure this and tell gnome-terminal to differentiate these keys.

The reason I am asking for this is because I use tmux in gnome-terminal and I'd like to bind tmux actions to C-S-z, C-S-d etc., but doing so renders the non-shift variants of those keys to the same tmux bindings. In other words, I want C-S-d to do a tmux action that I bind, but C-d to send an EOF. Currently, both these key combinations do the same thing, whatever it may be.

Someone on IRC freenode.net#tmux suggested that gnome-terminal might be sending the same key codes for both these key combinations and so tmux is unable to distinguish between them. I also learnt that xterm and rxvt can be configured to do this, but I'd like to know if gnome-terminal can do it.

Any ideas ont hsi appreciated :)

share|improve this question
add comment

1 Answer 1

If you don't need C-d at all (you can close a terminal with exit, after all), you could try to remove its association with EOF, and associate EOF with another unuseful sequence, C-j for example:

stty eof ^J

I cannot say if it also will free the use of C-S-d.

If it works, that command should be set in ~/.bashrc, for example.

share|improve this answer
    
That's an interesting solution, but I run many cli apps like mutt/vim/irssi etc., so, I'd still like to know if it could be done. –  Shrikant Sharat Aug 2 '11 at 10:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.