You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linux terminal shortcuts support in python shell #78074
Are you talking about the python shell, run in a text console window, or IDLE's GUI shell? The components you mark include both.
If the former, do you mean only on linux or all systems? You and Python are more or less at the mercy of the console you use + readline.
If you mean IDLE's Shell, you must give details: what key, what action. Is so, I suspect that at least some of your requests are either rejected or open issues.
sixstringseby commented on Jun 18, 2018
sixstringsebymannequin
MannequinAuthor
More actions
I meant this on Python IDLE across all platforms.
basic necessary enhancements for seamless use of IDLE should atleast have below feature supported.
clear(used in MAC/LINUX TERMINAL) or cls(used in WINDOWS CMD PROMPT) - clear the PYTHON IDLE screen.
up arrow - for the search history.
If this enhancements is in progress/open state then its good, if rejected this be reconsidered ?
These issues are not as simple as you think. But anyway, clearing the shell in bpo-6143.
Shell is a modified editor. Currently, the arrows move the cursor around just as in the editor. For multiline statements, this is essential, and even for single-line statements, not as useless as some claim. Single-line command consoles can get away with changing the meaning of Up and Down. This is discussed in bpo-2704, and what I said above is explained more in msg243140 of May 2015.
I have a question about Linux consoles. Windows Command Prompt is strictly a command *line* console. It sees
>>> deffib(n):
... if n >=2:
... return fib(n-2) + fib(n-1)
... else:
... return n
as 5 commands. Its history mechanism retrieves a line at a time. Does a Linux console retrieve all 5 at once, as IDLE does?
I have a question about Linux consoles. [...] Does a Linux console retrieve all 5 at once, as IDLE does?
Not typically. Like the Windows console, Linux consoles are also line-oriented, and hitting up-arrow cycles through each line, one at a time.
The bash shell offers a special "operate-and-go-next" command to operate on a particular history line and then immediately retrieve the next history line:
zsh lets you edit multiline shell commands as a unit. If you up-arrow, you get all the lines of the block popped up, with the cursor on the last line. Further arrow keys will navigate within the multiline text block, with an up-arrow from the first line taking you to the next previous shell command, and enter within the block will re-execute the entire modified multiline command. I haven't used IDLE recently enough to remember how that compares to how IDLE works.
Activity
sixstringseby commentedon Jun 18, 2018
simple linux terminal support in python shell,
like clear, ctrl + r, up arrow would be really good to have.
terryjreedy commentedon Jun 18, 2018
Are you talking about the python shell, run in a text console window, or IDLE's GUI shell? The components you mark include both.
If the former, do you mean only on linux or all systems? You and Python are more or less at the mercy of the console you use + readline.
If you mean IDLE's Shell, you must give details: what key, what action. Is so, I suspect that at least some of your requests are either rejected or open issues.
sixstringseby commentedon Jun 18, 2018
I meant this on Python IDLE across all platforms.
basic necessary enhancements for seamless use of IDLE should atleast have below feature supported.
clear(used in MAC/LINUX TERMINAL) or cls(used in WINDOWS CMD PROMPT) - clear the PYTHON IDLE screen.
up arrow - for the search history.
If this enhancements is in progress/open state then its good, if rejected this be reconsidered ?
terryjreedy commentedon Jun 18, 2018
These issues are not as simple as you think. But anyway, clearing the shell in bpo-6143.
Shell is a modified editor. Currently, the arrows move the cursor around just as in the editor. For multiline statements, this is essential, and even for single-line statements, not as useless as some claim. Single-line command consoles can get away with changing the meaning of Up and Down. This is discussed in bpo-2704, and what I said above is explained more in msg243140 of May 2015.
I have a question about Linux consoles. Windows Command Prompt is strictly a command *line* console. It sees
as 5 commands. Its history mechanism retrieves a line at a time. Does a Linux console retrieve all 5 at once, as IDLE does?
stevendaprano commentedon Jun 18, 2018
Terry asked:
Not typically. Like the Windows console, Linux consoles are also line-oriented, and hitting up-arrow cycles through each line, one at a time.
The bash shell offers a special "operate-and-go-next" command to operate on a particular history line and then immediately retrieve the next history line:
http://web.mit.edu/gnu/doc/html/features_7.html
but I think that's about as close as any standard Linux console gets to the ability to retrieve multiple lines from history at once.
bitdancer commentedon Jun 18, 2018
zsh lets you edit multiline shell commands as a unit. If you up-arrow, you get all the lines of the block popped up, with the cursor on the last line. Further arrow keys will navigate within the multiline text block, with an up-arrow from the first line taking you to the next previous shell command, and enter within the block will re-execute the entire modified multiline command. I haven't used IDLE recently enough to remember how that compares to how IDLE works.
terryjreedy commentedon Jun 18, 2018
Thanks. I have presumed that Linux consoles are also line oriented, but hesitated to say so without really knowing so.