Define custom escape sequences in terminal

Posted by Ipkiss on Super User See other posts from Super User or by Ipkiss
Published on 2013-10-27T09:33:36Z Indexed on 2013/10/27 9:58 UTC
Read the original article Hit count: 275

Filed under:
|

I would like to change the escape sequences used by some keys in my terminal. My goal is to define custom mappings in Vim (terminal version).

In the following I use shift-space as an example, but I would prefer if the proposed solution could be generic.

My current terminal (gnome-terminal) uses a simple space as escape sequence for shift-space, as can be seen by typing ctrl-v shift-space. A quick check with the true xterm shows the same behavior. I would like that the shift-space key combo generates another escape sequence (e.g., the one of shift-F30, which I would never use otherwise).

So, how would I go about doing that? And is it really a good idea? Let me know if there are better alternatives...

Note: I'm aware that this is only part of the problem: after the terminal sends a proper escape sequence for my keys, I still need to teach Vim what it means. But I think I know how to deal with that.

© Super User or respective owner

Related posts about terminal

Related posts about xterm

  • XTerm and a bold text

    as seen on Super User - Search for 'Super User'
    This is my Xterm config: XTerm*saveLines: 512 XTerm*reverseVideo: false XTerm*reverseWrap: true XTerm*fullCursor: true XTerm*scrollTtyOutput: on XTerm*scrollKey: on XTerm*eightBitInput: false XTerm*pointerColor: white XTerm*pointerShape: left_ptr XTerm*charClass: 37:48,45-47:48,58:48,64:48,126:48 XTerm*cursorColor:… >>> More

  • Coloring The Z Shell[closed]

    as seen on Super User - Search for 'Super User'
    Because I have to stare at my command prompt all the time on my computer, it should look at least half-decent, so I am trying to get it colored. The expected outcome is as seen on this site. I have the colors I want set in my .Xdefaults file, but they of course do not color my prompt. My .zshrc… >>> More

  • Coloring The Z Shell[closed]

    as seen on Super User - Search for 'Super User'
    Because I have to stare at my command prompt all the time on my computer, it should look at least half-decent, so I am trying to get it colored. The expected outcome is as seen on this site. I have the colors I want set in my .Xdefaults file, but they of course do not color my prompt. My .zshrc… >>> More

  • tput: unknown terminal

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I'm on AIX-6.1 and I'm trying to make use of tput inside my $PS1. I've confirmed I can't even run tput from the commandline. Following is my session: # tput unknown terminal "xterm" # echo $TERM xterm # tput -T ansi unknown terminal "ansi" In fact, ... # ls /usr/lib/terminfo/x x1700 xl83 … >>> More

  • xterm window gets stuck after some time

    as seen on Super User - Search for 'Super User'
    I am using xterm on RHEL with KDE. Usually after a couple of days, the xterm terminals get stuck i.e. I am not able to resize or relocate them. After this, even if I open a new terminal, it is stuck the same way. What I do is logout and login again. Is this a bug with xterm? Is there a known solution… >>> More