bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stty settings have no effect


From: Chet Ramey
Subject: Re: stty settings have no effect
Date: Mon, 6 Jan 2003 15:22:06 -0500

> Machine Type: i386-redhat-linux-gnu
> 
> Bash Version: 2.05b
> Patch Level: 0
> Release Status: release
> 
> Description:
>       Settings made with stty seem to have no effect.
> 
> Repeat-By:
>       For example, 'stty erase d', and then type some letters, and then
>       'd'.  A 'd' is shown, rather than acting as the erase character.
>       Not sure if this is a readline problem or not.

It's a readline `problem' in the sense that readline looks at the stty
settings only once -- when it's initialized for the first time by the
calling application.

It's pretty easy to write a shell function that synchronizes tty special
characters between the kernel and readline by using the `bind' builtin;
look at examples/functions/fstty for one such function.

Readline could easily be made to look at the special chars each time
it's called (and there's already a function to do that).  The problem
becomes keeping track of the old bindings.  The way the kernel's tty
driver works is that upon reading a character, it looks for the special
characters using what is essentially a case statement, and defaults to
`self-insert'.  In the readline implementation, the bindings for the the
old terminal special characters need to be changed back to `self-insert'.

Chet



-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )

Chet Ramey, ITS, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]