question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The more and less utilities (pagers) break command-line editing on macOS and Linux

See original GitHub issue

Note:

  • On macOS 10.14, both more and less produce the symptom, whereas it is only less 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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rkeithhillcommented, Sep 12, 2019

This has also been reported in the PSReadLine repo - https://github.com/PowerShell/PSReadLine/issues/1007 It is very annoying.

0reactions
mklement0commented, Sep 13, 2019

‘Resolution-External’ will auto closes the issue.

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).

If a native command is last in a pipeline will it rise the issue too?

more and less 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found