The more and less utilities (pagers) break command-line editing on macOS and Linux
See original GitHub issueNote:
- On macOS 10.14, both
more
andless
produce the symptom, whereas it is onlyless
on Ubuntu 18.04. - Whether or not the
PSReadLine
module is loaded makes no difference.
It took considerable discipline to refrain from more or less jokes.
Steps to reproduce
On macOS or Ubuntu, run the following and then press <kbd>q</kbd> to exit the pager:
# On macOS, `more` is affected too.
1..200 | less
Expected behavior
less
should exit, the command prompt should return, and command recall with <kbd>arrow up</kbd> should continue to function.
Actual behavior
less
exits and the command prompt does return, but command recall is now broken: an A
is printed instead.
Environment data
PowerShell Core v7.0.0-preview.3 on macOS 10.14.6
PowerShell Core v7.0.0-preview.3 on Ubuntu 18.04.3 LTS
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
What are the differences between most, more and less?
I'm now using Arch Linux, and find a command most works like more and less . To understand the differences between them is...
Read more >How to Use the less Command in Linux with Examples
The less command is a Linux terminal pager that shows a file's contents one screen at a time. It is useful when dealing...
Read more >5 cool terminal pagers in Fedora
Is less more than more? Check out this article on pagers that help you make sense of long text files in your Fedora...
Read more >When reading a file with `less` or `more`, how can I get ...
Is there anyway to let grep know just pipe less -R command and then just do coloring? So, we don't have to put...
Read more >scrolling down git diff from mac terminal
git diff uses the same pager as less Unix command. Use keys d and u to go down / up half pages (forward...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This has also been reported in the PSReadLine repo - https://github.com/PowerShell/PSReadLine/issues/1007 It is very annoying.
I guess a closed issue is better than none for discoverability, but it would more make sense to me to keep such issues open until the issue is actually resolved (externally).
more
andless
become effective no-ops (buffering changes aside) if you don’t use them as the last pipeline segment, so the issue doesn’t arise then - but it’s a useless use case.