Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-09-16 03:31:02

julian
Member
Registered: 2020-09-07
Posts: 29

(SOLVED) Terminal history repeats same command entered multiple times

In my experience, entering the same terminal command multiple times in succession will not result in that same command being added to the history multiple times. It will only be added once.

This doesn't seem to be the case for xfce4-terminal. Why is that? Was it a conscious choice to remove this for some reason?

It feels strange to press Up Arrow in the terminal, only to get the same command. I need to hold Up Arrow key for a while to get the older commands and would prefer the behavior in the first paragraph..

Last edited by julian (2020-09-16 12:06:31)

Offline

#2 2020-09-16 10:27:08

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 7,058

Re: (SOLVED) Terminal history repeats same command entered multiple times

Not really an xfce4-terminal thing, but a bash thing. Add:

export HISTCONTROL=ignoredups

...to (usually) ~/.bashrc.

Offline

#3 2020-09-16 12:14:34

julian
Member
Registered: 2020-09-07
Posts: 29

Re: (SOLVED) Terminal history repeats same command entered multiple times

That's the ticket, yes. big_smile

Marked as SOLVED

So the other OS has added this Bash line rather than it being removed by Xfce? Wondering if this can be a default for Xfce moving forward... or is this a distro thing?

Offline

#4 2020-09-16 16:09:58

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 7,058

Re: (SOLVED) Terminal history repeats same command entered multiple times

I would say it should be a distro thing, or user choice.

Offline

#5 2020-09-16 16:30:15

MrEen
Member
Registered: 2019-04-19
Posts: 239

Re: (SOLVED) Terminal history repeats same command entered multiple times

In my older Mint install, I have this in my .bashrc that accomplishes the same thing:

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

In this case, it was part of the install, not something I added. (I'm pretty sure.)

Offline

#6 2020-09-16 17:39:27

julian
Member
Registered: 2020-09-07
Posts: 29

Re: (SOLVED) Terminal history repeats same command entered multiple times

ToZ wrote:

I would say it should be a distro thing(...)

Thanks ToZ, is anyone from Manjoro on these forums? I'm racking up improvements and would rather talk to a dev on these forums.

Thanks for your extra info, MrEen.

Offline

Board footer

Powered by FluxBB