Jump to content


Photo

Feature Request - Shell History

Enigma2

  • Please log in to reply
9 replies to this topic

#1 hemispherical1

  • Senior Member
  • 1,596 posts

+49
Good

Posted 31 October 2011 - 06:08

Recently I realized I wasn't the only one that wished the DM800 would save shell command history across logins. I tried updating the busybox config (openembedded/recipes/busybox/busybox-1.18.5/openpli/defconfig), updating the options:

CONFIG_FEATURE_EDITING_HISTORY=100
CONFIG_FEATURE_EDITING_SAVEHISTORY=y

The resulting busybox binary seems to work fine & it didn't grow in size at all. Unless someone thinks it's too much wear & tear writing the history to flash (only reason not to add it I could think of), could this be added to the images?


Thanks,
--
hemi

Ps. I just noticed OE E1 image has it included already...

Edited by hemispherical1, 31 October 2011 - 06:45.


Re: Feature Request - Shell History #2 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 31 October 2011 - 09:05

I removed it, because that messes with the history if you have more than one shell at the same time (as is usually the case here).
This option saves the history before you logoff, and the other shell re-reads the history, as a result you have no usable history in either shell.

With the option disabled, at least you have a working history in every shell, though the history is not saved.

Re: Feature Request - Shell History #3 hemispherical1

  • Senior Member
  • 1,596 posts

+49
Good

Posted 31 October 2011 - 18:59

I guess that is that. If anyone wants to add the feature to their image, they can build an image with the edits noted above & force busybox to be rebuilt, or I'll add the dm800 binary I built with Oct.30 source code.

A note of caution, I had no trouble overwriting the existing busybox binary. I ftp'd it to /bin/busybox~ then in telnet cp /bin/busybox~ /bin/busybox & rebooted, it worked fine for me. Then I gave a copy to someone else and they managed to hose their box, requiring a reflash. I don't know what went wrong, but you've been warned. It would be a good idea to make a backup just in case... ;)


--
hemi

Ps. The binary was built for the dm800, I don't know if it has all the required calls compiled in for other mips e2 boxes.

Pps. Added the ipk.

Attached Files


Edited by hemispherical1, 31 October 2011 - 19:45.


Re: Feature Request - Shell History #4 bigroma

  • Member
  • 35 posts

+11
Neutral

Posted 31 October 2011 - 19:21

You can just install package after removing files in /var/lib/opkg. I think this way better then manual replacement file.

Re: Feature Request - Shell History #5 hemispherical1

  • Senior Member
  • 1,596 posts

+49
Good

Posted 31 October 2011 - 19:46

Yes, it probably is, I'm just a manual sort of guy... ;)


I added the ipk to first post.

--
hemi

Re: Feature Request - Shell History #6 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 31 October 2011 - 19:55

What would be even better is that somebody would fix the feature;
-read history at login
-write history at logoff

;)

Re: Feature Request - Shell History #7 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 31 October 2011 - 20:01

Just gave it a quick test, and actually, it's a lot more usable compared to when I last used, and disabled it in frustration.
history is not saved untill you logoff, and read only on login.
So they have fixed a few things in the meantime.

I'll add the history settings.

Re: Feature Request - Shell History #8 hemispherical1

  • Senior Member
  • 1,596 posts

+49
Good

Posted 31 October 2011 - 20:02

Thank you! ;)

--
hemi

Re: Feature Request - Shell History #9 jimux

  • Member
  • 33 posts

+1
Neutral

Posted 1 November 2011 - 16:59

There is no problem with having more than one busybox installed and provided you want to use it just for remote users then a readymade binary from busybox.net will suffice. Just put the second copy elsewhere on the path. I use /usr/local/bin as it is the first searched by a remote session but not by enigma. Initially set up some new user IDs with the adduser command and point to new shell. For example, create users admin and ashman as below....
/usr/local/bin/busybox adduser -h/home/admin -s/usr/local/bin/sh admin
/usr/local/bin/busybox adduser -h/home/ashman -s/usr/local/bin/ash ashman
Technomate box user (TM9100, TM800HD) and moderator on allsats.co.uk Linux/unix fan for many years.

Re: Feature Request - Shell History #10 jimux

  • Member
  • 33 posts

+1
Neutral

Posted 1 November 2011 - 18:43

Forgot to add..... Once remote users run latest busybox then they have full hush features, and individual IDs maintain history across their own sequential sessions. Try the smaller ash shell for remote users.
Technomate box user (TM9100, TM800HD) and moderator on allsats.co.uk Linux/unix fan for many years.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users