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

.