Up arrow key scrolls through past terminal entries Help?

kevinrf

New Member
Joined
Jul 12, 2022
Messages
3
Reaction score
2
Credits
30
Don't know if this is distro specific (this pc has Mint 20.3 MATE). When in terminal and I hit the up or down arrow, it scrolls through all of my previous entries rather than moving the cursor up or down the page. Outside of be being annoying, it is a security nightmare. How do I fix this issue? Specifically, getting the arrow keys to only move the cursor. Thanks for any help.

kevinrf
 


You need to disable bash history.

Code:
echo 'set +o history' >> ~/.bashrc
. ~/.bashrc

That'll disable it for your user.

Edit:

Also, clean existing history with:

Code:
history -c
 
Each individual user has their own history.
No one can see another person's history.
(well, unless you su to that user)
 
When I type
echo 'set +o history' >> ~/.bashrc
. ~/.bashrc

the up arrow still scrolled through history.

I am a noob, but learning it. I have a basic understanding of .bashrc and how to use it to enter aliases, but I think I am not entering your code correctly.
 
Did you follow the bit about deleting your history?

And, as @dos2unix said, it's not really a problem. Only you (and root) can see your .bash_history. It also doesn't contain any sensitive data, like passwords.

But, you add the bit between the quotes (no quotes) to ./bashrc and remove the existing history - and it *should* stop storing your history. You may want to try 'source ~/.bashrc' (no quotes) instead of the line with the . starting it.
 
kevinrf wrote:
When in terminal and I hit the up or down arrow, it scrolls through all of my previous entries rather than moving the cursor up or down the page. Outside of be being annoying, it is a security nightmare.
I couldn't help smiling at that comment. I can certainly think of far more nightmarish scenarios for a linux system than cursor movements. Moving the cursor in the terminal which is running in the GUI (i.e. in an X terminal of some type) is usually accomplished by using the mouse. For moving the cursor in a console terminal (non-GUI text environment) one can also use the mouse if the gpm program is installed. Being able to access history at the terminal prompt is a very useful facility which I use very often. Ridding oneself of history altogether is discarding information that can be very helpful, especially if one is using complicated commands which aren't so easy to recall with precision. My history is configured to run to 2000 commands.

On the matter of security vulnerability, I don't see that it's terminal commands that would be the greater problem ... if someone with ill intent has physical access to your computer to be pushing the keyboard arrow keys, the game is most likely up anyway. Even with more extensive measures like a BIOS password, physical access has ways around that too. If it's simply access to the info on the computer in a home or office environment that one is concerned about, using a screen lock may suffice.
 
When I accidently enter a password at the wrong point I either delete that history entree or I delete my whole history just because I don't like the face that a password is in my bash history but to be clear the only user that can read your bash history is you and root unless some other user has full sudo rights.
 
I'm okay closing the thread. There is enough info out there. I also read that I could type nano .bashrc scroll down to HISTORY and change the number to 0. That would be "permanent" though. I do appreciate Osprey's comment about the history could actually be more helpful than not, especially when you need it. So I think I will use the mouse to scroll in Terminal and chill out over the up arrow history oddity.
P.S. I am really liking this forum. There is lots of help here that I know I will be using over time. I thank all of you for your responses.
 
We don't really close threads, unless there's a reason - like wild digression long after the issue was resolved.

We leave them open in case someone has a question about something in the thread - in a reasonable amount of time.
 

Members online


Top