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

When closing the Code, the running bash will not exit properly and not save the history #179833

Closed
CastleStar14654 opened this issue Apr 13, 2023 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@CastleStar14654
Copy link

CastleStar14654 commented Apr 13, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.77.3
  • OS Version: Ubuntu 22.04.2 LTS

Steps to Reproduce:

  1. Open Code, launch the terminal inside
  2. Run whatever command in this terminal
  3. Directly and properly close the whole VS Code
  4. ~/.bash_history has not been appended with what we just did in the Code terminal
  5. If, however, logout the terminal (e.g. by Ctrl + D) first, then ~/.bash_history is updated as expected

The same problem also exists on Windows version (1.77.3, Windows 11 Home 22H2 22621.1555) for the bash with SSH- or WSL-Remote.

@CastleStar14654
Copy link
Author

Since both gnome-terminal on Linux or the Windows Terminal could handle the close of the window by logging out all sub-shells, I suppose that it is also possible for VS Code.

@akpircher
Copy link

akpircher commented Apr 14, 2023

I think VSCode used to exit the shell properly and save the command history.

My terminal.integrated.persistentSessionReviveProcess setting is set to "never", because opening VSCode with a clean/fresh terminal helps me stay focused on whatever I need to work on now, which is not necessarily where I left off. (In a similar vein, it would be nice to have a setting where I could open up a workspace and not have all of the previously opened files open)

The whole point of an interactive shell's exit process is so that programmers don't have to remember to call the history to manually save terminal history to the $HISTFILE, or to specifically run "exit" when closing a program. It happens automatically.

Is it VSCodes' intention to have their users rely solely on the programs cache or nothing at all? That would make VSCode completely unusable for me, and if this is the case then I need to find another IDE.

@david-fong
Copy link

Duplicate of #151105? (I'm in favour of changing that one's title to be non-windows specific)

@meganrogge
Copy link
Contributor

/duplicate #151105

@vscodenpa vscodenpa added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

5 participants