Commit 7b9ec690 authored by Kurt B. Kaiser's avatar Kurt B. Kaiser

In Shell:

1. If a tab is entered at the prompt, allow it to be backspaced away.
2. Eliminate the beep when hitting <enter> at the prompt.
parent f287ca93
...@@ -954,6 +954,8 @@ class EditorWindow: ...@@ -954,6 +954,8 @@ class EditorWindow:
want = ((have - 1) // self.indentwidth) * self.indentwidth want = ((have - 1) // self.indentwidth) * self.indentwidth
ncharsdeleted = 0 ncharsdeleted = 0
while 1: while 1:
if chars == sys.ps1:
break
chars = chars[:-1] chars = chars[:-1]
ncharsdeleted = ncharsdeleted + 1 ncharsdeleted = ncharsdeleted + 1
have = len(chars.expandtabs(tabwidth)) have = len(chars.expandtabs(tabwidth))
...@@ -1009,6 +1011,8 @@ class EditorWindow: ...@@ -1009,6 +1011,8 @@ class EditorWindow:
text.mark_set("insert", first) text.mark_set("insert", first)
line = text.get("insert linestart", "insert") line = text.get("insert linestart", "insert")
i, n = 0, len(line) i, n = 0, len(line)
if line == sys.ps1:
return "break"
while i < n and line[i] in " \t": while i < n and line[i] in " \t":
i = i+1 i = i+1
if i == n: if i == n:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment