Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL doesn't "remember" last session commands #2066

Closed
ghost opened this issue May 5, 2017 · 5 comments
Closed

WSL doesn't "remember" last session commands #2066

ghost opened this issue May 5, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented May 5, 2017

My build is 15063.158.

I ran different commands like ssh user@ip, I do some other actions, close the session and start another one later in that day but can't print commands from previous session with the arrows (top/button).

For some reason, WSL doesn't remember the commands from previous sessions.

I should note that I didn't felt such behavior in the last versions of Bash...

@CherryDT
Copy link

CherryDT commented May 5, 2017

Did you happen to have multiple terminals open in parallel? In that case see https://unix.stackexchange.com/questions/1288/preserve-bash-history-in-multiple-terminal-windows

Did you happen to close bash in a non-graceful way, e.g. closing the window instead of writing exit? This could also be the issue.

In any event it is bash which is managing the history, not WSL. (aseering is right that WSL does have a say there.)

@aseering
Copy link
Contributor

aseering commented May 5, 2017

@CherryDT , "it is bash which is managing the history, not WSL" -- that's true, but WSL is managing bash :-) For example, WSL could attempt to close bash gracefully when the window is closed, so that it has a chance to save its history.

@therealkenc
Copy link
Collaborator

therealkenc commented May 5, 2017

WSL is managing bash

This all goes to #834 (and many friends). Every bash session except the last one cleans up correctly (saves history) when the window closes. The last one does not, because the last bash session dies by kernel panic. User voice is here.

@fabd
Copy link

fabd commented Jun 28, 2017

@therealkenc Thank you.

Typing exit appears to work as a workaround (edit: also ctrl-d shortcut).

@therealkenc
Copy link
Collaborator

It appears from a cursory test that this was addressed as a happy side-effect of "Allow processes to run without an active terminal" (#709 et al) and possibly #2496. Going to mark as fixedinsiderbuilds 17046. If anyone is still seeing the lost history problem on insiders, ping the thread and I'll take a second look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants