-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Epic: Persisted Terminal History #9019
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
Comments
@akosyakov could we reuse what we built for VS Code user setting sync here? |
It maybe easy to use blob API from server. User setting sync is scoped to a user and versioned. It looks like here it is scoped to the same workspace and does not need support multiple versions.
@svenefftinge I'm not sure about this bit. If I start a completely new workspace I would expect that it is fresh. For me preserving history only between restarts of the same workspace actually makes sense. Maybe should be configurable. |
@akosyakov I would expect new workspaces to have empty history too. But, if I were to restart an existing one, having that history would be nice. If you "really" need something in a new workspace, I would argue that is what dotfiles are for. 😅 Another thing to consider is, how would a user delete history. Say for example, if it contained a secret they did not want persisted. |
One thing which come up today that there are many clients controlling shell sessions, i.e. supervisor, VS Code, JetBrains, OpenSSH server and so on? Which one we are talking here? If all of them and we don't need to sync between different workspace then maybe the history should be preserved as a part of workspace backup? @csweichel |
We would rely on the behaviour of the shell (e.g.
If we just back up the histfile, users can modify this file to delete things from their history. A few questions arise though:
|
@kylos101 I had the same needs and found that it's relatively easy to do from dotfiles alone [1] 😁 The idea is to create dummy hist files within |
Detection is rather tricky, a user can overwrite shell configuration on level of editors as well. Could not we store all?
I wonder for cross workspaces support how are we going to merge it? Last workspace wins and overwrites, always append? Should it sync in real time? |
found https://github.com/rcaloras/bashhub-client maybe somebody tried |
I do agree with keeping simple and limiting supported shells, but I must say that |
👍 for using HISTFILE approach. My expectation is that history is scoped to the workspace and is not shared between workspaces. |
Also the default shell on MacOS for a couple years now |
Personally, I need the history to be shared between workspaces. At the very least scoped per project. I'm 100% on board with the opening statement by @svenefftinge : "Gitpod should persist the terminal history between workspaces for the same project and user." |
I've seen several comments where people don't want to keep a history per project. I wonder why that is? I'm still very strongly thinking it should be per project. A relatively simple solution could be to store the history in an env variable. That has the right scope (project) and can be manually deleted in case the history contains information I want to get rid of. |
As a heavy user of terminals and terminal history (especially Ctrl+R), I love this proposal. Like @svenefftinge, my expectation would be to keep history per project. (E.g., losing all my history when I open a workspace for a new branch would be inconvenient.)
"Last workspace wins and overwrites" makes sense since it is similar to how bash history already works with multiple terminals. Plus, it would make it easier to delete history if there's information I want to remove. |
Any updates on this? Specifically: any workaround in place or theoretically possible. |
Okay, this wouldn't work, you need to rely on dotfiles, see below. |
@axonasif Unfortunately it looks like Do you think it would be possible to fix that in lieu of an official solution here, so we have a workaround option? |
@axonasif We actually applied a very similar change to your draft PR to our own Docker image, and this is where we discovered the truncation problem. Doing it in dotfiles is also subject to the same truncation. We are now doing |
@spearki ah, yeah, makes sense... I use |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Does #17612 close this? I just had it start working much to my surprise! |
@mgenereu only for the same workspace. We would like to support it more generally, i.e. across all user shells for instance. |
Should also note this is also enabled via 3rd parties like Atuin: https://www.gitpod.io/guides/persisted-terminal-history-atuin |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Context
Context
A terminal history is a very important productivity tool in local dev environments. With ephemeral workspaces we only have a history per session, which is inconvenient. Gitpod should persist the terminal history between workspaces for the same project and user. It's the expectation of all users coming from a local dev environment with a heavy use of terminals.
Acceptance Criteria
Out of scope
Archive
### Out of scopeThis feature doesn't necessarily need to be advertised, as it is an existing expectation when working with terminals. Users will be positively surprised to see that Gitpod finally keeps history state across multiple workspaces.
Persona(s)
All users with a terminal heavy workflow.
In scope
Keep history for our default shell (bash) for the same project and user.
Out of scope
Supporting all possible shells.
The text was updated successfully, but these errors were encountered: