Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to make two-lines prompt works better with the "less" pager? #1126

Closed
ZekeLu opened this issue Nov 25, 2020 · 2 comments
Closed

Comments

@ZekeLu
Copy link

ZekeLu commented Nov 25, 2020

When the prompt height is set to two lines, after quit the less pager, the output of the pager is pushed one line up. See the first image below.

What I want is keep the output of the pager on the screen without being pushed up. When the prompt height is set to one line, I can get the expected behavior. See the second image below.

I like the two lines mode very much! Is it possible to keep the output of the pager no moving in two lines mode?

Thank you in advance!

Prompt Height: two lines

Prompt Height: one line

@romkatv
Copy link
Owner

romkatv commented Nov 25, 2020

The output is moved up whenever anything is printed on the screen. There is no way around it. If your pager has an option to use only N - 1 lines of the screen (where N is the total height of your terminal), then you can achieve what you want. If your pager doesn't have this option, then you cannot.

@ZekeLu
Copy link
Author

ZekeLu commented Nov 26, 2020

Wow, I didn't expect to get your reply so soon! Thank you @romkatv !

I'm using the less pager. Its doc says that it will read from the environment variable LINES to set the number of lines on the screen, but it seems that this variable is controlled by the system, and I can not change it.

I have tried to customize the prompt of less to split it into two lines, but with no luck, I can not split it into two lines (\n and \r don't work).

I think I have to stay with the one line mode.

Your work is deeply, deeply appreciated. Thank you very much!

@ZekeLu ZekeLu closed this as completed Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants