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. And it's not a matter of being in or out of "curses mode"--it's a matter of writing to the terminal's alternate screen vs. its normal screen. Vim restores the terminal's normal screen when it exits (if t_ti and t_te are set), which means that it restores the image on the terminal to what it was before vim executed. Your 'echo "bye-bye"' is written to the alternate screen, just like everything else that vim displays. You're looking for some sort of VimLeavePostScreenSwitch event, which doesn't currently exist. Regards, Gary --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
