[svlug] App called during boot, weird backspace behavior

Robert Hajime Lanning lanning at lanning.cc
Wed Nov 14 22:23:02 PST 2001


The TERM environment variable is not set.

This is the behaviour for dumb terminals with no cursor control.

This was for the days that the terminals were keyboards and printers.
You could not erase what was printed so you did it symbolicly.

the "\" symbolizes the start of the erase pattern and the "/" shows the
end of the pattern.

So with "asdfg\gf/h" the "g" was erased from the input buffer, then the
"f" was erased.  "/" shows that the rest of the characters are appended
to the input buffer.  So, at the end of this string the input buffer
really looks like this "asdh".

---- As written by Ivan Passos:
> 
> 
> Hello,
> 
> I have a C application that reads strings typed by the user. Basically, it
> does the following:
> 
> tostr	-> the char vector that will hold the string
> maxlen	-> the maximum length of the input string
> stdin	-> standard input file descr.
> 
> 	fgets(tostr, maxlen, stdin);
> 	tostr[strlen(tostr)-1] = '\0';
> 
> 
> This app. works fine when called from a shell, but if I run it from one of
> the init scripts (_very_ early on, called by the rcS script), I get a
> weird behavior on backspace handling / displaying on the screen.
> 
> Normally I would get the following (i.e. app run from a regular shell):
> 
> asdfg
> {type BS}
> asdf
> {type BS}
> asd
> {type 'h'}
> asdh
> {type 'j'}
> asdhj
> 
> In this case, I get the following (i.e. app run from the init script):
> 
> asdfg
> {type BS}
> asdfg\g
> {type BS}
> asdfg\gf
> {type 'h'}
> asdfg\gf/h
> {type 'j'}
> asdfg\gf/hj
> 
> 
> The end result (i.e. the string read by the app) is correct, but this
> screen output is really confusing to the user!!
> 
> I've tried setting the TERM variable to 'linux', 'ansi', 'vt100', hoping
> that this was the reason (just because the app is called so early during
> the boot process -- yes, it was just a wild guess), but it didn't help.
> 
> BTW, this system uses a serial console (no VGA console available).
> 
> Does anyone have a clue as to why this is happening and how to fix it?
> 
> Thanks in advance for your help!
> 
> Later,
> Ivan
> 
> 
> _______________________________________________
> svlug mailing list
> svlug at lists.svlug.org
> http://lists.svlug.org/lists/listinfo/svlug
> 


-- 
/* Robert Hajime Lanning                             lanning at lanning.cc
** Trade: Unix Systems Administrator (Senior level) (SAGE IV)
*/
#include <std_disclaimer.h>




More information about the svlug mailing list