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

Vs code git bash terminal always forgets it's history after re-open #37273

Closed
joelharkes opened this issue Oct 31, 2017 · 5 comments
Closed

Vs code git bash terminal always forgets it's history after re-open #37273

joelharkes opened this issue Oct 31, 2017 · 5 comments
Assignees
Labels
*as-designed Described behavior is as designed terminal Integrated terminal issues

Comments

@joelharkes
Copy link

joelharkes commented Oct 31, 2017

  • VSCode Version: latest 64bit
  • OS Version: win 10

Steps to Reproduce:

  1. Use git bash as terminal
  2. Open git bash and type ls
  3. open vs code, type some other command (in the integrated terminal)
  4. close vs code and open again
  5. do arrow/cursor up. (in the integrated terminal)

The command shown is ls (history from git bash instead of git bash from vs code session).

I Expect either:

  • History to be remembered globally
  • Or history of the commands to be remembered per project/path.
@vscodebot vscodebot bot added the git GIT issues label Oct 31, 2017
@joaomoreno joaomoreno assigned Tyriar and unassigned joaomoreno Oct 31, 2017
@joaomoreno joaomoreno added terminal Integrated terminal issues and removed git GIT issues labels Oct 31, 2017
@Tyriar
Copy link
Member

Tyriar commented Nov 2, 2017

All the history is managed by the shell, in this case git bash. If you launch a single shell and exit it, the history will likely be retained. However it can be less reliable when there are multiple shells of the same type, but this happens regardless of the terminal as far as I'm aware.

@Tyriar Tyriar closed this as completed Nov 2, 2017
@Tyriar Tyriar added the *as-designed Described behavior is as designed label Nov 2, 2017
@joelharkes
Copy link
Author

How come it is only retained when I open git bash directly and is never retainer in vs code?

I'll do some more testing but s far I have never seen vs code => git bash retain anything. although opened manually it always seems to retain history

@Tyriar
Copy link
Member

Tyriar commented Nov 2, 2017

@joelharkes it's possible there's an issue on our side but it seems unlikely as we're just launching the git bash executable and that's accepting input and telling us the output. Since the git bash executable is the thing handling the input, it should be persisting the history somehow.

@joelharkes
Copy link
Author

Seems to depend on how you close the bash:
https://stackoverflow.com/questions/10488498/bash-history-does-not-update-in-git-for-windows-git-bash

It also seems my projects keep running when i close vs-code (and i started the project running yarn start)

it seems vs-code does not close integrated terminals properly?

@joelharkes
Copy link
Author

joelharkes commented Nov 27, 2017

A solution would be to either properly close git-bash on vs code close.

or enable the use of executing commands (through settings) when integrated shell/vscode closes.

the command that would be needed to execute is: history -a

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

3 participants