maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Xterm does not saved all executed commands (https://talk.maemo.org/showthread.php?t=37178)

casper27 2009-12-14 18:21

Xterm does not saved all executed commands
 
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?

fnordianslip 2009-12-14 18:24

Re: Xterm does not saved all executed commands
 
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.

casper27 2009-12-14 18:27

Re: Xterm does not saved all executed commands
 
Thanks I will give it a bash..... No pun intended lol
Cheers

Bratag 2009-12-14 18:34

Re: Xterm does not saved all executed commands
 
Quote:

Originally Posted by casper27 (Post 427479)
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.

rewt 2009-12-14 18:36

Re: Xterm does not saved all executed commands
 
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.

casper27 2009-12-14 18:44

Re: Xterm does not saved all executed commands
 
Quote:

Originally Posted by rewt (Post 427504)
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.:)

josh 2009-12-14 18:44

Re: Xterm does not saved all executed commands
 
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.

fnordianslip 2009-12-14 18:51

Re: Xterm does not saved all executed commands
 
Quote:

Originally Posted by qole (Post 427534)
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.

lma 2009-12-14 19:59

Re: Xterm does not saved all executed commands
 
Quote:

Originally Posted by qole (Post 427534)
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).

josh 2009-12-14 21:11

Re: Xterm does not saved all executed commands
 
Quote:

Originally Posted by lma (Post 427653)
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.


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

vBulletin® Version 3.8.8