Loading ...
Sorry, an error occurred while loading the content.
 

Re: gvim problem with &

Expand Messages
  • Tony Mechelynck
    ... Console Vim doesn t need a pseudo terminal, he was talking about gvim. Running :!tty in gvim gives (on my system) /dev/pts/0, in konsole it gives various
    Message 1 of 4 , Oct 29, 2007
      Gautam Iyer wrote:
      > On Tue, Oct 30, 2007 at 10:15:08AM +1100, Ben Schmidt wrote:
      >
      >>> !xdvi -hushstdout -s 5 -geometry 1024x900+416+0 -expert %<.dvi &
      >>>
      >>> which works fine from vim, but not from gvim.
      >> I think what is happening is that Vim is creating a pseudo-terminal,
      >> running the command, and then killing the pseudo terminal (and
      >> consequently all commands attached to it) as soon as control is
      >> returned (which is basically immediately due to your &). I come up
      >> with this solution:
      >
      > I don't think Vim creates a new pseudo terminal. When I run :!xdvi &, I
      > see a whole bunch of junk Xdvi status / error messages in my precious
      > tex file all the time. (They of course disappear when I redraw the
      > screen).
      >
      > You can of course confirm this by running "tty" before you run Vim,
      > ":!tty" from Vim, and ":!tty&" from Vim. The first and second give the
      > same number. The third gives "Not a TTY". (I don't have Gvim on my
      > system so I have no idea what happens there.)
      >
      > GI
      >

      Console Vim doesn't need a pseudo terminal, he was talking about gvim.

      Running ":!tty" in gvim gives (on my system) /dev/pts/0, in konsole it gives
      various other /dev/pts/<number>, in the Linux text consoles (virtual
      terminals) /dev/tty1 to /dev/tty6.

      ":!tty &" replies nothing; ":!bash -ic 'tty &'" replies [1] 19356 followed by
      /dev/pts/0 (where 19356 is, I suppose, the process number of the forked process).

      So I think yes, gvim creates a pseudo terminal. If I repeat the command I get
      /dev/pts/0 again but I suppose once the terminal has been closed its device
      can be reused.


      Best regards,
      Tony.
      --
      Commitment, n.:
      Commitment can be illustrated by a breakfast of ham and eggs.
      The chicken was involved, the pig was committed.

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Ben Schmidt
      ... Indeed. Thanks for clarifying that, Tony. ... Yes; I confirmed that before I wrote, actually. I will get the same ptty used over and over if I just
      Message 2 of 4 , Oct 29, 2007
        > Console Vim doesn't need a pseudo terminal, he was talking about gvim.

        Indeed. Thanks for clarifying that, Tony.

        > So I think yes, gvim creates a pseudo terminal. If I repeat the command I get
        > /dev/pts/0 again but I suppose once the terminal has been closed its device
        > can be reused.

        Yes; I confirmed that before I wrote, actually. I will get the same ptty used over
        and over if I just repeatedly do :!tty from gvim, but if I open another terminal
        window in between, it takes that ptty and then :!tty will give me a different one.

        Cheers,

        Ben.



        Send instant messages to your online friends http://au.messenger.yahoo.com


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      Your message has been successfully submitted and would be delivered to recipients shortly.