gnome-terminal doesn't save the entire history if 2 are open

Bug #392871 reported by Gianfranco Costamagna
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gnome-terminal

try to open two gnome-terminal

1)type on the first
cmd1
cmd2
cmd3
cmd4

2)type on the second
cmd5
cmd6
cmd7
cmd8

Now if you close the first and after the second your history will show
1 cmd5
2 cmd6
3 cmd7
4 cmd8

otherwise if you close the second and after the first your history will be
1 cmd1
2 cmd2
3 cmd3
4 cmd4

in my opinion history SHOULD be updated after each command!

Regards

Gianfranco

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

This bug affects each ubuntu release with every gnome-terminal version!

(now I'm using the latest gnome-terminal, built by me)

Revision history for this message
Pedro Villavicencio (pedro) wrote :

thanks for the report, i'm getting the same behavior with xterm, probably this isn't a gnome-terminal issue, could you please try with other terminals emulators as well? thanks.

Changed in gnome-terminal (Ubuntu):
assignee: nobody → Ubuntu Desktop Bugs (desktop-bugs)
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Could you give me some emulators' names please?

thanks

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

Could anybody help me in updating description??? The bug still exist in karmic and gnome.terminal 2.28.2

Revision history for this message
Pedro Villavicencio (pedro) wrote :

did you tried the same with terminator and xterm?

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

same behavior with terminator, xterm seems to be working

Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

sorry, I did a mistake... xterm and terminator seem to work

Revision history for this message
WeatherGod (ben-v-root) wrote :

Unless I am wrong, I believe that this has been a long understood and well documented 'bug' of bash.

Revision history for this message
Pedro Villavicencio (pedro) wrote :

WeatherGod do you have the bug number of that bash bug?

Revision history for this message
WeatherGod (ben-v-root) wrote :

Pedro, I can't find a bug report yet, but I have found some discussions about this. There are a lot of pros and cons with the different approaches. The 'problem' is mostly with bash's approach with managing multiple sessions (i.e. - it doesn't, nor should it). gnome-terminal can invoke bash in special ways to do different things with the history file and get different behaviors. However, as I understand it, the current setup for gnome-terminal emulates the behavior of being logged into simultaneous tty sessions.

Here are some postings about how to sync the history file between multiple terminals (however, I am not advocating them):
http://fixunix.com/slackware/369510-bash_history-file.html
http://briancarper.net/blog/keeping-bash-history-in-sync-on-disk-and-between-multiple-terminals
http://lists.gnu.org/archive/html/bug-bash/2007-08/msg00016.html
http://groups.google.com/group/gnu.bash.bug/browse_thread/thread/873e3e06f76c78c7/5d5d5e99945bcd69

The issue with trying to sync multiple sessions together is actually very messy. The question is *how* should they be synced? Should it be appended line-by-line? Or should the entire session be appened when the session finishes? Or should it be that the last session gets to have the file? What if a user has two different terminal emulators up, both using bash? What about a session within a session?

Here are a couple of discussions about the issue:
http://groups.google.com/group/gnu.bash.bug/browse_thread/thread/64587d478d40f84d/72b9f72bcba7e546
http://groups.google.com/group/gnu.bash.bug/browse_thread/thread/d10e25a877d92218/65dd823c150914b7

Now, I would like to quickly make a clarification within the description. When closing the second terminal and examining the history in the first terminal, the "history" command will have the first terminal history, because that is the history in memory for that terminal. However, what happens to the .bash_history file depends upon how that "in-memory" history is appended to the history file.

On my current system (Fedora 11), it appears that each terminal's history is appened to the history file when the gnome-terminal is closed.

I merely post this as a source of information for further discussion. I am not advocating any particular position, I am merely pointing out the non-obvious messiness that comes with the history feature.

Changed in gnome-terminal (Ubuntu):
status: Incomplete → New
Revision history for this message
Gianfranco Costamagna (costamagnagianfranco) wrote :

I don't understand... With karmic and all the recent updates this seems to be fixed... I mean the entire session is appended when the session finishes...

So seems to be a bug fix....

Changed in gnome-terminal (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.