screen-users
[Top][All Lists]
Advanced

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

Re: piping files to vim command line, results in dead screen


From: Joe Zbiciak
Subject: Re: piping files to vim command line, results in dead screen
Date: Wed, 11 Aug 2004 15:15:00 -0700 (PDT)

Zenaan, All,

I found it, and it's not really a screen issue, but more
likely a shell and/or VIM related issue.  VIM does this
magic:

/*
 * If reading stdin results in an error, continue 
 * reading stderr.
 * This helps when using "foo | xargs vim".
 */
if (!did_read_something  &&
    !isatty(read_cmd_fd) && 
    read_cmd_fd == 0)
{
    int m = cur_tmode;

    /* We probably set the wrong file descriptor 
     * to raw mode.  Switch back to cooked mode, 
     * use another descriptor and set the mode to
     * what it was. */
    settmode(TMODE_COOK);
#ifdef HAVE_DUP
    /* Use stderr for stdin, also works for 
     * shell commands. */
    close(0);
    dup(2);
#else
    /* read from stderr instead of stdin */
    read_cmd_fd = 2;    
#endif
    settmode(m);
}

Cute, huh?  Well, it appears the *shell* (bash) gets
confused when VIM exits, at least on my RedHat 7.3 box.
In my case, it appears bash's readline just hangs.  I'll
grasp at straws and suggest it might be
controlling-terminal
related.

The AIX and Solaris boxen also get a little weird, but
they're fixed with an "stty sane."

Mystery "solved?"


Regards,

--Joe




--- Zenaan Harkness <address@hidden> wrote:

> On Thu, 2004-08-12 at 05:08, Adam Monsen wrote:
> > On Wed, 11 Aug 2004 17:05:37 +1000, Zenaan Harkness
> <address@hidden> wrote:
> > > When I pipe multiple files to vi, via xargs (with a
> find, may be a cut,
> > > etc), eg:
> > > 
> > > find blah|grep blahh|cut dodah|xargs vi -o
> > 
> > Point of clarification: does this work as you'd expect
> in
> > xterm/gnome-terminal/konsole/virtual terminal when
> screen *isn't*
> > running? It doesn't for me.
> 
> Vim comes up nicely with a buch of files for me to edit,
> which I do.
> Then when I exit the last file, the terminal hangs. This
> happens both in
> and outside of screen.
> 
> 
> _______________________________________________
> screen-users mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/screen-users
> 


=====
We sell Spatulas, and that's all!
http://spatula-city.org/~im14u2c/
http://sdk1600.spatula-city.org/
http://intyos.spatula-city.org/




reply via email to

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