Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This problem starts when I use emacs ( with -nw option). Let me first explain it. I tried to define hotkey (for emacs) as following

(global-set-key [(control shift up)] 'other-window)

but it doesn't work (no error, just doesn't work), neither does

(global-set-key [(control shift down)] 'other-window)


(global-set-key [(control shift right)] 'other-window) 


(global-set-key [(control shift left)] 'other-window)


But because the last two key combinations are used by emacs (as default), I don't wanna change them for other functions.

So how could I make control-shift-up and control-shift-down work?

I have googled "(control shift up)", it seems that control-shift-up is used by other people, (but not very few results).

In the Stack Overflow forum, Gille answered me as following:

Ctrl+Shift+Up does send a signal to your computer, but your terminal emulator is apparently not transmitting any escape sequence for it. So your problem is in two parts. First you must get your terminal emulator to send an escape sequence, which depends on your terminal emulator, and is Super User material, or Unix.SE if you're using a unix system. Then you need to declare the escape sequence in Emacs, and my answer explains that part

So I come here for this question:

How do I get my terminal (I use ubuntu 10.04, and the built-in terminal) to send an escape sequence for Control+Shift+Up Control+Shift+down

share|improve this question
up vote 3 down vote accepted

Ubuntu uses GNOME and gnome-terminal. According to its documentation (in version 2.30), CtrlShiftUp and CtrlShiftDown are used for navigating the scrollback buffer, and there doesn't seem to be any way to turn this "feature" off (aside from modifying the source code1 of vte, the terminal library).

1 Like this.

share|improve this answer
Thank you very much! But could you teach me something? First of all, "patch" adds your code to the source code of vte? (Sorry, but I just start to learn C, and still on the level of "if" "while"..etc) If next time, I want to something similar (for example, say control+shift+backspace), could I just replace "up" in your code with "backspace", then do the commands you mentioned in your comment? Thank you again! – user565739 Jan 9 '11 at 18:54
@user: 1) Sort of. This particular patch only removes the code that would otherwise steal these two keypresses. In the output of diff -u, added lines start with a + and removed lines start with a -. 2) You would have to edit vte.c itself, not my or anyone else's patch. But remember that not all keys have their own sequences. – grawity Jan 9 '11 at 19:55
@user: Also, I forgot to add sudo apt-get build-dep vte to instructions in that page; you will probably need to run the command before doing dpkg-buildpackage. – grawity Jan 9 '11 at 19:58
I extract the files from vite_1.0+snv834-5.orig.tar.gz, and there are many folders, and in each folder, there are many .cpp and .hpp files. What's the best way to find out the part needed modify? (In my mind, I think I need to know some basic knoledge to figure out a keyword, then do something like "search a word in all files inside a folder")? – user565739 Jan 9 '11 at 20:10
@grawity: I have already done the steps you mentioned, and it works fine. Thanks – user565739 Jan 9 '11 at 20:14

Ctrl+Shift+Up / Ctrl+Shift+Down do seem to be captured by the gnome default terminal, however I tend to use a terminal called "Terminator" on 10.04, where these keys do not seem to be mapped.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .