From c36767fc62af9d4867b6490a52c84659360fe015 Mon Sep 17 00:00:00 2001 From: Guillaume Chazarain Date: Fri, 9 May 2008 18:39:05 +0200 Subject: [PATCH] Forward Ctrl-D to the remote shells --- NEWS | 2 +- gsh/stdin.py | 2 +- tests/tests/control_commands.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 0dd2c07..fc1bb1d 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,7 @@ o Added a --log-file=LOG_FILE option aggregating all remote shells o Removed --quick-sh as it is now the default o Replaced the control shell with colon prefixed commands o The prompt uses readline even when not all remote shells are ready -o Ctrl-C and Ctrl-Z sent to gsh are forwaded to the remote shells +o Ctrl-C, Ctrl-D and Ctrl-Z sent to gsh are forwaded to the remote shells o Shell commands prefixed by an exclamation mark are run locally o Added the :chdir control command to change the local directory o Added the :hide_password control command, to use with su(1) for example diff --git a/gsh/stdin.py b/gsh/stdin.py index f56ce13..a86c4e3 100644 --- a/gsh/stdin.py +++ b/gsh/stdin.py @@ -260,7 +260,7 @@ class stdin_thread(Thread): cmd = raw_input(self.prompt) except EOFError: if not self.interrupt_asked: - cmd = ':quit' + cmd = chr(4) # Ctrl-D if self.interrupt_asked: cmd = None self.in_raw_input.clear() diff --git a/tests/tests/control_commands.py b/tests/tests/control_commands.py index 6243108..f7800c2 100644 --- a/tests/tests/control_commands.py +++ b/tests/tests/control_commands.py @@ -122,6 +122,7 @@ class TestControlCommands(unittest.TestCase): testEcho('back to no logging') child.sendline(':log_output /tmp/gsh_test.lo\t') testEcho('appended to the log') + child.sendline(':log_output') child.sendeof() child.expect(pexpect.EOF) @@ -133,7 +134,7 @@ localhost: still logging > :log_output > echo appended to the log localhost: appended to the log -> :quit +> :log_output """.strip() actual_log = ''.join(file('/tmp/gsh_test.log').readlines()).strip() self.assertEqual(actual_log, EXPECTED_LOG) -- 2.11.4.GIT