Retrieve previous command in less command [solved]

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Post Reply
vimes666
Level 6
Level 6
Posts: 1241
Joined: Tue Jan 19, 2016 6:08 pm

Retrieve previous command in less command [solved]

Post by vimes666 »

From the less manual:

Code: Select all

UPARROW [ ESC-k ]
              Retrieve  the  previous  command line.  If you first enter some text and then press
              UPARROW, it will retrieve the previous command which begins with that text.

This does not work for me. up and down arrows as well as ESC-k or j only scroll the text up and down :(

Funny thing is, few weeks ago, all of a sudden it worked at a moment that I didn't want it to. Alas, I have no idea how I inadvertently managed to that. I tried several old installs of mint on the standard terminal emulation and in a native terminal. All have the same behaviour.

I am now at a point that I really need this retrieve function, so if anyone has a hint, I'd be much much obliged.
Last edited by vimes666 on Tue Dec 19, 2023 8:00 am, edited 1 time in total.
If you think the issue is solved, edit your original post and add the word solved to the title.
1000
Level 6
Level 6
Posts: 1040
Joined: Wed Jul 29, 2020 2:14 am

Re: Retrieve previous command in less command

Post by 1000 »

This is probably the wrong section to get proper help.
However, if your problem is caused by changing settings, so everything should work as usual in the new user account.
Try check.

Edited
And I hope you know that " UPARROW [ ESC-k ] " will work only
for example when you enter the text to search " / "

For example in search mode also will work ESC-k
ESC-h will move cursor to the left and ESC-l will move the cursor to the right.

When you press Esc-h and if unwanted signs appear, then I guess it may be related to the sensitivity setting for pressed key,
I mean that there is a waiting time for the next character to be pressed. After this time you will see ESCESCESCESC ....
but these are just my guesses.
motoryzen
Level 10
Level 10
Posts: 3497
Joined: Sun Dec 08, 2019 12:25 am

Re: Retrieve previous command in less command

Post by motoryzen »

If all else fails ( and I recommend you continue being patient to allow some more people here to recommend some reasonable ideas to try imo), you could try copying your gnome-terminal ( if you're using cinnamon desktop ) from your Linux Mint Cinnamon installation boot drive ( boot into that, open two windows..both as root

<<<*** warning..though *** This will obviously revert all things you customized about gnome-terminal back to stock/defaults >>>

1 window for your root directory of the boot drive

2nd window for your Mint cinnamon installed drive's root directory

navigate to both windows to the same place. /bin

This worked for me ( replacing my Mint's installed gnome-terminal with a what i call " stock " copy directly from the Mint's boot drive's /bin directory.) when my gnome-terminal wouldn't launch one day. and I didn't want to do a clean LM installation.
Mint 21.2 Cinnamon 5.8.4
asrock x570 taichi ...bios p5.00
ryzen 5900x
128GB Kingston Fury @ 3600mhz
Corsair mp600 pro xt NVME ssd 4TB
three 4TB ssds
dual 1TB ssds
Two 16TB Toshiba hdd's
24GB amd 7900xtx vid card
Viewsonic Elite UHD 32" 144hz monitor
vimes666
Level 6
Level 6
Posts: 1241
Joined: Tue Jan 19, 2016 6:08 pm

Re: Retrieve previous command in less command

Post by vimes666 »

1000 wrote: Mon Dec 18, 2023 9:28 pm This is probably the wrong section to get proper help.
In hindsight, yes you are right. I should have posted it in the silly idiots section :)
Because:
And I hope you know that " UPARROW [ ESC-k ] " will work only
for example when you enter the text to search " / "
Indeed I did not realise that you have to type a / or a & first before the uparrow.
Thank you very much, this was driving me crazy.
If you think the issue is solved, edit your original post and add the word solved to the title.
Post Reply

Return to “Scripts & Bash”