Command history in mksh shell?

Kernels & Hardware, configuring network, installing services

Command history in mksh shell?

Postby bedtime » 2018-07-26 19:50

When I speak of 'command history', I speak of being able to press the <up> or <down> keys to retrieve the last command entered into the terminal—even after the session has been ended. Currently, I have no way to retrieve the past commands via <up> and <down> arrow keys, which is quite costly for me. I've endured this for a few months, and now it's time to fix it if possible.

I've checked the man pages. I've scoured the net with several different search terms. There is info on ksh and other shells, but I've yet to find any info on mksh specifically.

I should add that the history works fine while in a session, but once I exit and reenter the mksh shell, they are gone; the arrow keys bring up nil. I want such to persist if possible.
OS: Debian GNU/Linux (Buster—testing); Kernel: 4.16.0-2-amd64; Shell: sh; WM: i3
Machine: HP ProDesk 600 G3—i7-7700, 8GB RAM, 256 SSD, Intel HD Graphics 630

bedtime
 
Posts: 93
Joined: 2012-12-16 19:34

Re: Command history in mksh shell?

Postby Head_on_a_Stick » 2018-07-26 19:54

Code: Select all
set -o emacs

^ Add that to ~/.mkshrc (or copy the supplied example mkshrc over to $HOME).

Set $HISTFILE to maintain a persistent history.
dbruce wrote:Ubuntu forums try to be like a coffee shop in Seattle. Debian forums strive for the charm and ambience of a skinhead bar in Bacau. We intend to keep it that way.
User avatar
Head_on_a_Stick
 
Posts: 8322
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Command history in mksh shell?

Postby bedtime » 2018-07-26 20:14

Head_on_a_Stick wrote:
Code: Select all
set -o emacs

^ Add that to ~/.mkshrc (or copy the supplied example mkshrc over to $HOME).

Set $HISTFILE to maintain a persistent history.

Thanks. Working great now!
OS: Debian GNU/Linux (Buster—testing); Kernel: 4.16.0-2-amd64; Shell: sh; WM: i3
Machine: HP ProDesk 600 G3—i7-7700, 8GB RAM, 256 SSD, Intel HD Graphics 630

bedtime
 
Posts: 93
Joined: 2012-12-16 19:34


Return to System configuration

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable