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

Re: 6.0z: Aborted scp makes stdin line buffered

Expand Messages
  • Bram Moolenaar
    ... It looks like scp does something to the terminal that Vim doesn t undo. Vim does try to set the terminal back to a mode it prefers, but perhaps
    Message 1 of 3 , Apr 1, 2001
    • 0 Attachment
      Andreas Gunnarsson wrote:

      > Try this:
      > - Edit a file
      > - :e scp://some.hostname.with.sshd/file
      > - CTRL-C when asked for passphrase
      > - :buf 1
      > - Do some stuff in the first file (moving the cursor up and down a couple of
      > hundred times works)
      >
      > Vim seems to lose control over the input; when a key is pressed it is
      > echoed to the screen and vim doesn't handle the input until return is
      > pressed. It is as if stdin becomes buffered when the password question
      > is interrupted, but not until after a while.

      It looks like "scp" does something to the terminal that Vim doesn't undo. Vim
      does try to set the terminal back to a mode it prefers, but perhaps something
      is missing for your system. Look in mch_settmode() in os_unix.c.
      Unfortunately there is no "reset_tty()" function...

      --
      BEDEVERE: Wait. Wait ... tell me, what also floats on water?
      ALL: Bread? No, no, no. Apples .... gravy ... very small rocks ...
      ARTHUR: A duck.
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
      ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
      \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
    • Andreas Gunnarsson
      I m sorry I haven t investigated this until now, but I have been too busy with other things. It turns out that it is not vim s fault. scp lingers and resets
      Message 2 of 3 , May 6, 2001
      • 0 Attachment
        I'm sorry I haven't investigated this until now, but I have been too busy
        with other things.

        It turns out that it is not vim's fault. scp lingers and resets the
        terminal settings after control has been returned to vim.
        This is what happens:
        - scp fork()s and execvp()s ssh to do the actual copy
        - ssh asks for the passphrase
        - when ^C is pressed, scp exits and vim continues but ssh is still running
        - after a while ssh realises that scp has exited so it restores the terminal
        settings and exits

        I can't think of a simple work around for vim to fix this, I'll try to fix
        scp instead.

        Andreas

        On Sun, Apr 01, 2001 at 12:42:58PM +0200, Bram Moolenaar wrote:
        >
        > Andreas Gunnarsson wrote:
        >
        > > Try this:
        > > - Edit a file
        > > - :e scp://some.hostname.with.sshd/file
        > > - CTRL-C when asked for passphrase
        > > - :buf 1
        > > - Do some stuff in the first file (moving the cursor up and down a couple of
        > > hundred times works)
        > >
        > > Vim seems to lose control over the input; when a key is pressed it is
        > > echoed to the screen and vim doesn't handle the input until return is
        > > pressed. It is as if stdin becomes buffered when the password question
        > > is interrupted, but not until after a while.
        >
        > It looks like "scp" does something to the terminal that Vim doesn't undo. Vim
        > does try to set the terminal back to a mode it prefers, but perhaps something
        > is missing for your system. Look in mch_settmode() in os_unix.c.
        > Unfortunately there is no "reset_tty()" function...
        >
        > --
        > BEDEVERE: Wait. Wait ... tell me, what also floats on water?
        > ALL: Bread? No, no, no. Apples .... gravy ... very small rocks ...
        > ARTHUR: A duck.
        > "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
        >
        > /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        > ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
        > \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      Your message has been successfully submitted and would be delivered to recipients shortly.