Reply
Thread Tools
casper27's Avatar
Posts: 844 | Thanked: 521 times | Joined on Jan 2009 @ UK southampton
#1
As the title says Xterm does not seem to save all previous executed commands. Usually in terminal you can press the up arrow and scroll through previous command to save typing it all again. Xterm seems vert hit and miss saving some and missing quite alot. Anyone else have this or have found a work around?
 

The Following User Says Thank You to casper27 For This Useful Post:
fnordianslip's Avatar
Posts: 670 | Thanked: 359 times | Joined on May 2007
#2
I think this is down to the use of ash as the default shell. One option is to install bash, and configure user to use it. It works for me. Its in one of the extras(-foo) repos somewhere, all usual caveats apply.
__________________
Class .. : Lame hacker & beardy boffin
Humour . : [#######---] Alignment: Apathetic anarchist
Patience : [####------] Weapon(s): My cat, my code.
Agro ... : |#---------] Relic(s) : N900, MacBookPro, NSLU2, N800, SheevaPlug, Eee-901, Core2-Quad, PS3
"In theory, theory and practice are the same. In practice, they're not."
--
Beware of extras-devel.
 

The Following 2 Users Say Thank You to fnordianslip For This Useful Post:
casper27's Avatar
Posts: 844 | Thanked: 521 times | Joined on Jan 2009 @ UK southampton
#3
Thanks I will give it a bash..... No pun intended lol
Cheers
 
Posts: 2,014 | Thanked: 1,581 times | Joined on Sep 2009
#4
Originally Posted by casper27 View Post
As the title says Xterm does not seem to save all previous executed commands. Usually in terminal you can press the up arrow and scroll through previous command to save typing it all again. Xterm seems vert hit and miss saving some and missing quite alot. Anyone else have this or have found a work around?
Chances are your history is set to a small number and its only saving the last 10 commands or so - you can tweak that in your profile.
__________________
Class .. : Power Poster, Potential Coder
Humor .. : [*********] Alignment: Chaotic Evil
Patience : [***-------] Weapon(s): +2 Logic Mace
Agro ... : |*****-----] Relic(s) : G1, N900

 

The Following User Says Thank You to Bratag For This Useful Post:
Posts: 150 | Thanked: 93 times | Joined on Oct 2009 @ Pennsylvania, US
#5
It's possible that your .ash_history has the incorrect permissions/ownership. This should only occur if the first time you open xterm you sudo gainroot - since no .ash_history exists, when you exit root's shell it is created with only root having permission to write (preventing non-root command history from being written to the file).

Use 'ls -l /home/user/.ash_history' to verify. If the file is owned by root (3rd column), that is your problem.

sudo gainroot
chown user.users /home/user/.ash_history

OR

sudo gainroot
chmod a+w /home/user/.ash_history

Either will fix the permissions to allow non-root command history to be retained.

Last edited by rewt; 2009-12-14 at 18:44.
 

The Following 7 Users Say Thank You to rewt For This Useful Post:
casper27's Avatar
Posts: 844 | Thanked: 521 times | Joined on Jan 2009 @ UK southampton
#6
Originally Posted by rewt View Post
It's possible that your .ash_history has the incorrect permissions/ownership. This will probably only occur if the first time you open xterm you sudo gainroot - since no .ash_history exists, when you exit root's shell it is created owner=root, group=root preventing non-root command history from being written to the file.

Use 'ls -l /home/user/.ash_history' to verify. If the file is owned by root (3rd column), that is your problem.

sudo gainroot
chown user.users /home/user/.ash_history

OR

sudo gainroot
chmod a+w /home/user/.ash_history

Either will fix the permissions to allow non-root command history to be retained.
Sweet worked great cheers.
 
Posts: 55 | Thanked: 72 times | Joined on Nov 2009
#7
Two notes about this:

First, I found that ~/.ash_history, the file where ash normally saves history information, had root as the owner and group; this prevented saving history. Check and see if you have the same problem, and if so, remove ~/.ash_history. See bug 5896 for one reason that might happen.

Second, note that history does *not* get saved if you click the X in the upper-right corner of the xterm. Instead, type "exit", or press ctrl-d. See bug 5317 for that.

Last edited by josh; 2009-12-14 at 18:47.
 

The Following 11 Users Say Thank You to josh For This Useful Post:
fnordianslip's Avatar
Posts: 670 | Thanked: 359 times | Joined on May 2007
#8
Originally Posted by qole View Post
By the way, anyone tried bash for the N900 yet?
Yes. Working fine for me at the mo. Only for user, root still uses ash.
__________________
Class .. : Lame hacker & beardy boffin
Humour . : [#######---] Alignment: Apathetic anarchist
Patience : [####------] Weapon(s): My cat, my code.
Agro ... : |#---------] Relic(s) : N900, MacBookPro, NSLU2, N800, SheevaPlug, Eee-901, Core2-Quad, PS3
"In theory, theory and practice are the same. In practice, they're not."
--
Beware of extras-devel.
 

The Following User Says Thank You to fnordianslip For This Useful Post:
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#9
Originally Posted by qole View Post
Now I know it is because I usually use the "X" icon to close my terminals. I will use "exit" from now on.
Note also the easier workaround buried at the end of bug 5317 comment 7:

Code:
echo "trap exit SIGHUP SIGINT SIGTERM" >> /home/user/.profile
(though I think catching just SIGHUP should be enough for the osso-xterm case).
 

The Following 7 Users Say Thank You to lma For This Useful Post:
Posts: 55 | Thanked: 72 times | Joined on Nov 2009
#10
Originally Posted by lma View Post
Note also the easier workaround buried at the end of bug 5317 comment 7:

Code:
echo "trap exit SIGHUP SIGINT SIGTERM" >> /home/user/.profile
(though I think catching just SIGHUP should be enough for the osso-xterm case).
Yeah, I can confirm that just
Code:
echo 'trap exit SIGHUP' >> .profile
makes ash save history even if you just close the xterm.
 
Reply


 
Forum Jump


All times are GMT. The time now is 00:49.