This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can you prevent overwriting previous command history?

Tags: history, konsole history, konsole history, konsole
(comma "," separated)
conkde
Registered Member
Posts
1
Karma
0
When using the up and down arrows to scroll through commands, each one seems to remember any modifications you make to the command from your history.

For example, lets say that I execute the following command:
$ echo "I might need to slightly modify this command several times in the future, so please save it for me"

Then I enter another command:
$ echo "That sounds reasonable"

Now I hit the up arrow 2 times to enter a variation of the first command:
$ echo "I might need to slightly modify this command several times in the future, so please save it for me"

I want to modify this command to be the following:
$ echo "I might need to slightly modify this command several times in the future, thankfully it got saved"

I hold down backspace to delete some of it, but accidentally delete too much:
$ echo "I might need to

In order to get back the original command that got executed (that I wish to modify) I need to execute what is in the buffer for that history slot. And in a lot of cases that is not possible as the resulting command could have negative effects.

The simplest solution would be a shortcut that resets the current command history slot without needing to hit enter. Please let me know if this is already a thing.

A better solution would be to copy and append the modified command to the end of the history slots.

So rather than directly modifying the history slot:
> 123
> 1234
> 12[]
> 123456

You would create a new copy and append it:
> 123
> 1234
> 12345
> 123456
> 12[]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]