so I want to alow horizontal scrolling in the terminal for my custom bash command by piping the output of the command to | less -S
However, if I do this, once you exit less, the output of the command will not stay in the command line history
Is there a way to configure less to keep the output of the command in the history when you exit less?
Eg. if you look at git diff
, you can perform horizontal scrolling and then exit but the output still stays in the history in which you can then type new commands...I essentially want to emulate this for my custom bash command. Also in git diff
it performs horizontal scrolling on the spot (ie. without using a new screen) and the command line history is still visible whereas for less
it would do it in its own screen and you won't be able to see the command line history while "lessing". Would it be possible to emulate this git diff-like mechanism in less as well?
If there's any other solution without using less
feel free to throw it out there
UPDATED QUESTION
So suppose I do this:
cat loremipsum | less -FRSX
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sed
And then I press right twice so that it scroll to the right twice. And then I press q to exit less. The output that remains on the screen will then be:
cat loremipsum | less -FRSX
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam sed
ESCOC
dictum diam. Nullam quis urna ullamcorper, accumsan quam vitae, aliquet
ESCOD
nisl. Maecenas vitae lorem orci. Ut vel est erat. Cras quis sagittis sapien, ac volutpat metus.
username@server:~/httpdocs$
However in git diff when you do the same and then press q, only the last part (ie the last part of the screen where I scrolled to the right)
git diff
nisl. Maecenas vitae lorem orci. Ut vel est erat. Cras quis sagittis sapien, ac volutpat metus.
username@server:~/httpdocs$
Will remain on the screen
How do I get this to happen as well
more
support horizontal scrolling, which is being asked for here? If so, I can't figure out how to enable it. – Digital Trauma