On Sep 23, 6:22 pm, Gary Johnson <[email protected]> wrote:
> On 2009-09-23, viki wrote:
> > On Sep 23, 3:00 pm, Tim Chase <[email protected]> wrote:
> > > > .vimrc:
> > > >     au VimLeave * :call PrintAtExit()
> > > >     function! PrintAtExit()
> > > >         echo "bye-bye"
> > > >         !echo bye-bye
> > > >     endfun
>
> > > > Expecting
>
> > > >    $ vim foo
> > > >    ZZ
> > > >    bye-bye
>
> > > > But "bye-bye" does not appear. Anybody has an idea how to print
> > > > in VimLeave  so that it's visible after vim quit to shell ?
>
> > > It depends on your terminal.  The xterm (and its ilk) have two
> > > screens that can be switched between.  For hairy details, you can
> > > read at
>
> > >    :help xterm-screens
>
> > > So when Vim starts, it usually flips to the alternate screen, and
> > > then upon exit (after your "echo" attempts) switches back to the
> > > primary screen.  As detailed in the help above (under "NOTE 2"),
> > > you can try adding
>
> > >    set t_ti= t_te=
>
> > Yes, this is related.
> > In fact, I want to have the usual screen flipping AND I want to see
> > the final :!echo printouts. The strange thing happens with :!echo.
> > They are not seen when in Vimleave. They are printed in the
> > curses-mode screen, which is weird. In all other places in vim,
> > :!echo is printed in "shell-screen".
>
> > Is it a vim bug ? I'd prefer a vim function that prints to "original
> > screen".
>
> > I tried to add set t_ti= t_te= to the PrintAtExit() function, this did
> > not help me.
>
> It's not a bug.  

I refer to the  :!echo, the shell command execution.
In vimscript, :!echo writes to *original* screen (unlike :echo).
When doing :!echo, vim switches to original screen, does system(),
switches back to alternate screen. Results of :!echo always appear on
*original* screen. Always, except for au VimLeave. This "except" is
what
has smell of a bug.

Can you explain why in au VimLeave, when vim still operates in
alternate
screen, :!echo does not write to normal screen as in the rest of vim ?



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to