]> arthur.barton.de Git - bup.git/commitdiff
ftp: output a newline on EOF when on a tty
authorGabriel Filion <lelutin@gmail.com>
Sat, 14 May 2011 23:07:56 +0000 (19:07 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Sun, 15 May 2011 21:23:40 +0000 (17:23 -0400)
Using the 'quit' command with ftp while in interactive mode -- attached
to a tty -- ends up clearing the line for the shell to use a fresh one
for the next prompt.
Using Ctrl-D to send an EOF to the application's input while in
interactive mode currently does not clear the line in the same way.

Let's force a newline when an EOF is received from a tty so that the
program exits in a more aesthetic way.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
cmd/ftp-cmd.py

index d63a7106f55a8a8b75ecdcda869c27e0e9eef91b..18fd1b02ff89c9cc78b9ab99fb9202437832c2ea 100755 (executable)
@@ -58,6 +58,7 @@ def inputiter():
             try:
                 yield raw_input('bup> ')
             except EOFError:
+                print ''  # Clear the line for the terminal's next prompt
                 break
     else:
         for line in sys.stdin: