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

History not saved on some machines #3966

Closed
XinranZhao opened this issue Dec 14, 2019 · 7 comments
Closed

History not saved on some machines #3966

XinranZhao opened this issue Dec 14, 2019 · 7 comments
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@XinranZhao
Copy link

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.476]

Windows Terminal version (if applicable): 0.7.3382.0

Any other software?
Ubuntu 16.04.6 LTS

Expected behavior

command history can be saved and got accessed by command 'history'

Actual behavior

I have the same profiles.json file for multiple pc machines running Win10. Strangely, some of them can save history properly and some of them cannot. Can you help me with some hint what is stopping some machines from saving command history?

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 14, 2019
@zadjii-msft
Copy link
Member

@XinranZhao What shell are you using (cmd, powershell, bash, zsh, etc.)? It's typically the responsibility of the shell to save the command history, so whatever problem you're having is probably related specifically to the shell, not the terminal, though I'll be happy to help you figure it out 😄

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Dec 16, 2019
@XinranZhao
Copy link
Author

XinranZhao commented Dec 17, 2019

@XinranZhao What shell are you using (cmd, powershell, bash, zsh, etc.)? It's typically the responsibility of the shell to save the command history, so whatever problem you're having is probably related specifically to the shell, not the terminal, though I'll be happy to help you figure it out 😄

@zadjii-msft Appreciate your reply. As mentioned I only use terminal for WSL coding so the shell is bash:

GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

I am comparing two Win10 PCs of mine, with the same profile.json setting for windows terminal, and exactly the same .bashrc for WSL, but one of them can save history and the other cannot. Can you advise me how to troubleshoot this problem?

Thanks!

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Dec 17, 2019
@XinranZhao
Copy link
Author

I agree that this is not an issue with WT, so I herein close this thread. Thanks a lot for the help!

@sinistram
Copy link

It will be great to support history keeping in the terminal (for cmd and etc).

@DHowett-MSFT
Copy link
Contributor

@sinistram thanks for the feedback! As per #3966 (comment) not really the terminal's job to save history... unless you're referring to the scrollback history.

@sinistram
Copy link

@DHowett-MSFT I mean in windows cmd, powershell and etc history of called commands is not keeping after shell restart. And it will be great to have a functionality for keeping commands history even after pc reboot (like in osx).

Imagine that you have some long command and every time you restart terminal you have to write command again and again. I understand that cmd is not providing this feature, but may be it is possible to implement it in the terminal?

@DHowett-MSFT
Copy link
Contributor

The main reason command history is so bad in cmd and legacy powershell is because we implemented it in the “terminal” 25 years ago.

The windows console host keeps track of the history for every legacy process.

Please switch to a more civilized shell, like powershell 6 or 7. Even powershell 5.1 supports saving history to a file. The only shell in common modern use that doesn’t is cmd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

4 participants