Solution for terminal input problem



(my english is bad, sorry)
Hi, this thread is for programmers who like console applications
(ncurses based).

As you all know, terminal emulators have a big problem with user input.
Their input system is good for CLI, but really sucks when using full
screen applications like vim, emacs, mc, ncmpc, htop, rtorrent, irssi
(I mean all ncurses based or slang based which use cursor movement).
Examples of this problem:
- Ctrl-L and Ctrl-Shift-L generate the same single byte in the
terminal; namely 0x0c. They are indistinct.
- Ctrl-I and Tab generate the same single byte in the terminal; namely
0x09. They are indistinct.
- UTF-8, Alt+letter, Esc-letter all generate the same bytes in the
terminal. E.g. é vs. Alt+C Alt+) vs. Esc C Esc )

But there is no simple and nice solution. Problems cannot be solved
without fixing the terminal itself and without breaking some backward
compatibility. But I think a lot of console-addicted programmers want
to solve them.

So, here is my way of solving this problem.
http://nsf.110mb.com/termbox/termbox-concept.html

The main idea is to add a new terminal mode called "RAW input". This
mode will send special events almost directly from X11 to console
application. On this page I introduced a simple demo application and the
rxvt-unicode-9.02 patch.

In this version of my hack, echoing in terminal is broken. You can't
enable echo with this new mode yet. But I can solve this too. It is
simple and needs a little bit more hacking of terminal. Terminal should
start all input messages with unique escape sequence and when it
receives echo of these messages, it should ignore them. But also
terminal should send these input messages *with* usual symbols, so they
can be echoed.

So I want to know what do you think about all this. And also I want to
know if anyone is interested in such project.

Thank you for your attention.

P.S. There are also some talks in the net about this problem:
http://www.nabble.com/Improve-vim%27s-keyboard-input-subsystem-to16734943.html

.



Relevant Pages

  • Re: Console in graphic mode
    ... > I'm writing ncurses application which works fine under console (in ... But i can not find anything in X which could emulate vt100 ... What does ncurses think your TERM is? ... translates them into X keysyms, then passes those keysyms to the ...
    (comp.os.linux.misc)
  • Re: Stalker: Clear Sky To Be Released Exclusively On Steam... according to Toms Hardware
    ... That normal in console world: the earlgames are piss-poor job, ... and when the developers become more familiar with the unit, ... and the programmers are completely lost in the beginning. ...
    (comp.sys.ibm.pc.games.action)
  • Re: [PATCH]console:UTF-8 mode compatibility fixes
    ... be needed in ncurses for a few more years. ... Shall we add another kludge to accommodate Linux console? ... and send two replacement glyphs or better one replacement glyph and one space ... displaying/cut/paste/edit operations. ...
    (Linux-Kernel)
  • Re: Set/get console cursor position without use ncurses
    ... I'm looking for a way to get and set the cursor position in a Linux ... console application but without use the ... Having read some of the interminable discussion going on about this, and understanding the point that ncurses is actually the "correct" way to do it, if all you want to do is move the cursor, and if you are prepared to wear the fact that somewhere, someone _might_ have some whacky "terminal" that is completely nonstandard, you can't go far wrong by just looking up the ANSI terminal escape code and bunging it into your output as and when needed. ...
    (comp.os.linux.development.apps)
  • Re: Looking for ASM programmers.
    ... I am currently seeking around 10 programmers who are ... He will be using existing technology for the console ... We are seeking a bunch of professional ASM ... > - Operating system development experience an extreme plus ...
    (alt.lang.asm)