bash: fkfk: command not found...
^[[A^[[A^[[A[matt@localhost xwin]$ xwinsample1
Look at the linux command sequence above:
I type garbage, then while terminal emulator is waiting I hit up arrow key. Those "^[[A" sequences I think are actually inline terminal control characters, defined around 1840, I think before Abe Lincoln was elected.
Who looks at terminal emulation codes? No one locally. The emulator emulates an emulating terminal server while the user IO emulates the terminal itself. It is designed this way for remote access. The sequence means roll the big mechanical drum y notches, slam that darn bar to the left, then skip X paces with a huge mechanical space skipper. Seriously, I have used one of these mechanical terminals from the 1940s era, this is all correct.
Should we be using terminal control codes for remote control of the screen? No, a very stupid idea. When we log into a remote machine we do it with a real processor, not a wooden typewriter. The placement of text on the user screen is defined by the structure of the data being returned from the remote operation, skip the terminal codes altogether and come up with a simple placement syntax like:
strout(str,x,y);
Xchars does this.
I have a version of stdio.h chars, it writes a character based screen, it uses printf, works fine it is 30 lines of code and includes strout(str,x,y) which just writes text to a 2D character string. Works great, does all the data structure I need for complex subsystems.
So, I pick up an xcb code which has strout, or equivalent, it is all of 100 lines of code and lets you select the font. Ad scr9ololing and get 150 lines of code. That is simple xchars,. So dump xterm and any equivalent, go with Xchars and let the sub systems figure out how useful a two dimensional string display can be. Leave cursor placement up to the device generating structured char data.
Quit assuming the world is full of folks typing away on an 1840s typewriter. Modern terminal emulation gone replaced with simple Xchars. Then do an almost complete replacement of ncurses with an additional thousand lines for over lapping windows and structured input, or not. Make the enhanced Xchars an option.
No comments:
Post a Comment