Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: stty not working



On Tue, 02 Sep 2014 08:52:30 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 2,  2:26pm, Peter Stephenson wrote:
> }
> } [...] However, when we enter zle we call zsetterm() --- I
> } think typically in zrefresh() though the logic for setting up the
> } terminal seems a bit obscure --- which does...
> } 
> }     /* sanitize the tty */
> }     shttyinfo.tio.c_lflag |= ICANON | ECHO;
> } 
> } It's not entirely clear to me we should be doing that: the rest of
> } zsetterm() assigns shttyinfo to a local variable and then proceeds to
> } set up for line editing using operations on that
> 
> Yes, but it appears that user-defined widgets and completion use the
> global shttyinfo to re-sanitize any time there's an opportunity for
> an external command to have changed something.

The point here is that you *do* want the external command to change it
--- but maybe only sometimes.

> So we'd at least need another zle global for this.  I don't think it's
> commonly enough needed to justify the change; the question that started
> this thread was resolved by "unsetopt zle".

I certainly agree it's not important enough to break anything, but I'm
not entirely sure another global makes sense anyway --- when would you
use it that you didn't instead use the existing one?  You'd effectively
have a three-way switch --- zle mode, sane mode, user-defined mode ---
and defining the way the switch works is going to be difficult,
particularly given the fairly ill-defined way the effective two-way
switch plus additional sanity works at the moment.

As long as no one really expects ttyctl to save the state we can drop
this.

pws



Messages sorted by: Reverse Date, Date, Thread, Author