0

I'm writing a minimalistic shell for university and I stumbled on a problem: I can't read ctrl-arow_up and ctrl-arow_down on all terminals.

I tried cat -e then pressed those keys in Guake termnial - nothing happened. But when I tried the same in xterm or default ubuntu Terminal, it worked (it showed "^[[1;5A" and "^[[1;5B").

How do I make it work in all terminals? Or how do I disable shell key preprocessing?

litelite
  • 2,857
  • 4
  • 23
  • 33
Emil Terman
  • 526
  • 4
  • 22
  • 1
    Related: https://stackoverflow.com/q/7767702/2404501 –  Aug 29 '17 at 19:52
  • @ThomasDickey that link does not have a solution for my case. It says to use readline library. But I'm not allowed to use something like that. – Emil Terman Aug 29 '17 at 19:58
  • 1
    In short, to make your program work in ALL terminals, you need to accept that some terminals (including, I think, the classic VT220 that most of them are emulating) don't provide any way to detect modifier key + function key combinations. Make sure all your application's features are accessible without going through such obscure key combinations. –  Aug 29 '17 at 19:59
  • @WumpusQ.Wumbley okay... I thought there was a way – Emil Terman Aug 29 '17 at 20:01
  • For any specific terminal emulator, there might be a way to turn on xterm-like functionality. If not, you can submit bug reports asking for it. But it's up to the terminal emulator to make this possible by sending *some* distinct escape sequence. –  Aug 29 '17 at 20:05

0 Answers0