Skip to content

Commit 41ea474

Browse files
committed
Exit on <control>D when on a tty
1 parent e3930e1 commit 41ea474

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,8 @@ def pseudo_raw_input(self, prompt):
998998
self.poutput(safe_prompt, end='')
999999
self.stdout.flush()
10001000
line = self.stdin.readline()
1001+
if len(line) == 0:
1002+
line = 'eof'
10011003
else:
10021004
# we are reading from a pipe, read the line to see if there is
10031005
# anything there, if so, then decide whether to print the

0 commit comments

Comments
 (0)