LatexBox_View() blows display in terminal

Bug #642341 reported by Manuel Pégourié-Gonnard
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Vim LaTeX Box
In Progress
Undecided
Unassigned

Bug Description

Hi,

I've got a problem with LatexBox_View when using vim (as opposed to gvim): I've got a mostly blank terminal after running it, and need to press Ctrl-L in order to redraw the screen and see the file content (as well as statusline, etc) again.

This is apparently due to the use of silent: even a simple ":silent exe '!true'" tiggers the same undesirable behaviour. I'm using vim 7.3, I don't know if this is version dependent, or even a bug specific to my vim binary.

Anyway, removing the silent from the last line of the function solves the problem and seems to have no undesirable side effects.

Also, it would be nice to add '>/dev/null 2>&1' to the viewer call, so that its (error) output doesn't get mixed to vim's output, or at least make an option to add it.

By the way, why to reuse 'outputfile' as the argument to shellescape(), instead of calling LatexBox_GetOutputFile() again?

Manuel.

Changed in vim-latex-box:
assignee: nobody → David Munger (mungerd)
Revision history for this message
David Munger (mungerd-deactivatedaccount) wrote :

Removing the silent caused GUI Vim to wait for print multiple lines and wait for the user to press Enter. So I decided to add a check on has("gui_running") to use silent or not. Could you test it please from the current trunk before I release?

About calling LatexBox_GetOutputFile() twice: it was obviously not on purpose. Thanks for pointing it out.

Changed in vim-latex-box:
status: New → In Progress
Revision history for this message
Manuel Pégourié-Gonnard (mpg) wrote : Re: [Bug 642341] Re: LatexBox_View() blows display in terminal

Le 19/09/2010 02:26, David Munger a écrit :
> Removing the silent caused GUI Vim to wait for print multiple lines and
> wait for the user to press Enter.

I cannot reproduce that, but maybe it depends on the viewer used (I tested only
with xpdf) or some other setting.

> So I decided to add a check on
> has("gui_running") to use silent or not. Could you test it please from
> the current trunk before I release?
>
I did. Everything works fine for me.

Btw, I noticed you didn't redirect stderr to /dev/null. Is it intentional? If
so, could you make an option for that? (I realise multiplying options is not
always good, so I won't complain if the answer is "no".)

Thanks,
Manuel.

Revision history for this message
Jakob (hellwoofa) wrote :

Hey there,

I’ve started using latex-box today (got it from and am quite satisfied with it, but I encounter the same issue as outlined in the original post.

If I compile my document (ll), start the viewer (lv), or clean Latex output (lc) I always have to redraw my window in order to get back editing my tex file.

Im using Archlinux 64bit, vim 7.3.294. However, I have to add that I’ve got gvim installed (there exists a vim package without gui as well on Arch, but it doesn’t let me set servername which in turn prevents latexmk from working, so I am obliged to use vim from the gvim package.) When using gvim, everything is just fine!

I’ve originally used Latex-Box version from vim.org: 0.9.4 from 2011-02-07, but now also tried revno 50 from bzr here on launchpad: Same problem!

If you need any further details in order to solve the problem, I’d be glad to help!
Thank you very much for this great suite!

Best, Jakob

Revision history for this message
David Munger (mungerd-deactivatedaccount) wrote :

Guys, I need help here. I applied the same fix for latexmk (ll) and latexmk clean (lc) as I did previously for view (lv), but I keep getting that "Press Enter" message. You can diff from rev 50 to rev 52 if you want to see the changes. I have the same setup as Jakob.

Revision history for this message
Jakob (hellwoofa) wrote :

I simply love vim!

Found this wiki site: http://vim.wikia.com/wiki/Avoiding_the_"Hit_ENTER_to_continue"_prompts

and the important part is here:
Finally, you can use :silent to keep external commands from triggering the "Hit ENTER" prompt:
===============
:silent !echo Hello
===============
If the command generates any output, you may need to manually refresh the screen once you return to Vim (by typing Ctrl-L or entering :redraw!). If you're running a GUI version of Vim, :silent may keep you from seeing any output from the command at all! To fix the above problem with regular vim, you can use a custom command like this one:
=========================
command! -nargs=1 Silent
\ | execute ':silent !'.<q-args>
\ | execute ':redraw!'
========================
Use it like a regular command:
:Silent command

I’ve just put the Silent command definition into the beginning of latexmk.vim and inserted “Silent“ in lines 83 and 159 before “execute“ and it works!

Beautiful!

Revision history for this message
David Munger (mungerd-deactivatedaccount) wrote :

Okay! That's good news. I put the "silent" back for all versions, but added a "redraw!" for non-gui vim. In trunk.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.