[BusyBox] vi: Telnet commands instead of termios [RFC]

Shaun Jackman sjackman at gmail.com
Sat Mar 19 02:51:05 UTC 2005


On Fri, 18 Mar 2005 16:50:10 -0500, Paul Fox <pgf at brightstareng.com> wrote:
>  > editors/vi.c uses termios -- tcgetattr and tcsetattr -- to switch the
>  > terminal between raw mode and cooked mode.
> 
> not an unreasonable thing to do.

Not at all. I was giving context for the list.
 
>  > My embedded system doesn't
>  > have termios, so I modified those two functions to spit out some
>  > Telnet commands. I wrapped this in an #ifdef
>  > CONFIG_FEATURE_USE_TERMIOS, and let Telnet commands be the default.
>  > Perhaps the better plan would be to check for
>  > CONFIG_FEATURE_USE_TERMIOS first, if not that then
>  > CONFIG_FEATURE_USE_TELNET_COMMANDS, and if not that then make
>  > rawmode() and cookmode() be no-ops.
> 
> is there a reason you can't emulate (some subset of) termios on
> your system using your telnet tricks?

That's exactly what I will be doing. How does a full blown *nix system
handle this situation? If you telnet from a terminal to a telnetd and
then run a full screen editor, such as vi, which uses termios calls to
disable echoing and cooked mode, does the telnetd process translate
those termios calls to Telnet commands?
 
> in any case, making this telnet thing be the default is unacceptible.
> which environment do you suspect is more common?  :-)
> 
> termios should be the default -- imo, other environments should make
> the adjustments.

$ grep -A2 TERMIOS util-linux/Config.in
config CONFIG_FEATURE_USE_TERMIOS
        bool "  Use termios to manipulate the screen"
        default y

CONFIG_FEATURE_USE_TERMIOS is the default.

Since busybox offers the CONFIG_FEATURE_USE_TERMIOS switch, it would
be excellent if it was observed universally, and alternatives to
termios given. If it's decided that termios is universal and a
mandatory feature of the underlying OS, then
CONFIG_FEATURE_USE_TERMIOS would be best removed. Arguments can be
mode for both, but a compromise offers no continuity.

Cheers,
Shaun



More information about the busybox mailing list