On Monday, August 11, 2014 11:30:06 AM UTC-7, Bram Moolenaar wrote:
> Jacob Niehus wrote:
>
>
>
> > > > I narrowed it down to the point I can reproduce it with no
>
> > > > configuration file. Apparently keys typed while a shell command is
>
> > > > executing are drawn on screen immediately, then drawn again after the
>
> > > > command finishes. Also I should have mentioned before that this is not
>
> > > > Cygwin-specific; it just was more apparent on Cygwin because Cygwin is
>
> > > > slow, relatively speaking.
>
> > > >
>
> > > > vim -u NONE -i NONE -c 'autocmd InsertCharPre * call system("sleep 1")'
>
> > >
>
> > > Sounds like echo is on while executing the system command, but the typed
>
> > > character is not consumed by the external command.
>
> > >
>
> > > Switching echo off may have undesired side effects, e.g. for a command
>
> > > that asks for confirmation.
>
> > >
>
> > > Perhaps we could detect we get a key right after system() and redraw.
>
> > > That will cause flicker though.
>
> >
>
> > After some more digging, I gather you are referring to settmode(),
>
> > where the options are TMODE_COOK, TMODE_SLEEP, and TMODE_RAW.
>
> > TMODE_COOK allows directly typing characters on screen even while I
>
> > have Vim stopped at a breakpoint in gdb. Using TMODE_SLEEP in
>
> > mch_call_shell() in unix.c instead of TMODE_COOK makes the problem go
>
> > away and system() commands still work, but I don't know what the side
>
> > effects would be. I'm having a hard time looking up cooked shells
>
> > without finding articles about seafood :)
>
>
>
> I'll ask a colleague to fix that :-).
>
>
>
> The command executed with system() would normally read the text from
>
> stdin. But it's possible to open stderr for input and read text there,
>
> e.g. for a prompt. I can't think of a good example of a command that
>
> does this.
>
>
>
> --
>
> Bypasses are devices that allow some people to dash from point A to
>
> point B very fast while other people dash from point B to point A very
>
> fast. People living at point C, being a point directly in between, are
>
> often given to wonder what's so great about point A that so many people
>
> from point B are so keen to get there and what's so great about point B
>
> that so many people from point A are so keen to get there. They often
>
> wish that people would just once and for all work out where the hell
>
> they wanted to be.
>
> -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
>
>
>
> /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
>
> /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
>
> \\\ an exciting new programming language -- http://www.Zimbu.org ///
>
> \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
How about an optional argument for the system() command to disable echo?
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.