You are not logged in.

#1 2008-06-14 16:04:01

nsf
Member
From: Yekaterinburg, Russia
Registered: 2007-09-15
Posts: 160
Website

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 an 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.


Bmpanel2 and obkey developer.

Offline

#2 2008-06-16 06:09:21

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Solution for terminal input problem

nsf wrote:

So I want to know what do you think about all this.

I think that you might want to find a more specialized place to get more valuable feedbacks. But also that I never noticed these input problems so it has never bothered me wink


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#3 2008-06-16 07:04:12

nsf
Member
From: Yekaterinburg, Russia
Registered: 2007-09-15
Posts: 160
Website

Re: Solution for terminal input problem

shining wrote:
nsf wrote:

So I want to know what do you think about all this.

I think that you might want to find a more specialized place to get more valuable feedbacks. But also that I never noticed these input problems so it has never bothered me wink

Yes, I think I should try usenet news groups smile
These input problems are not so big deal, but when you want to use your keyboard at maximum, they kick your ass big_smile
I discovered this problem when I was working on ncurses minimalistic replacement. But in the net there are talks about this too.
Here for example: http://www.nabble.com/Improve-vim%27s-k … 34943.html

Last edited by nsf (2008-06-16 07:06:37)


Bmpanel2 and obkey developer.

Offline

Board footer

Powered by FluxBB