-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[supervisor] Persist bash history across workspace restarts PRD-59 #17612
Conversation
@@ -1006,6 +1006,9 @@ func buildChildProcEnv(cfg *Config, envvars []string, runGP bool) []string { | |||
envs["JAVA_TOOL_OPTIONS"] += fmt.Sprintf(" -Xmx%sm", mem) | |||
} | |||
|
|||
envs["HISTFILE"] = "/workspace/.gitpod/.bash_history" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe check if SHELL is not specified or bash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not need, only bash respect this env
I try with zsh, it's just not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe we just rename it to .shell_history
? not sure
it seems zsh is using the same env var?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe we just rename it to .shell_history? not sure
ok
@@ -1006,6 +1006,9 @@ func buildChildProcEnv(cfg *Config, envvars []string, runGP bool) []string { | |||
envs["JAVA_TOOL_OPTIONS"] += fmt.Sprintf(" -Xmx%sm", mem) | |||
} | |||
|
|||
envs["HISTFILE"] = "/workspace/.gitpod/.bash_history" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if this two env already exists?
I'm not sure it is actually fixing PRD-59. It is definitely an improvement, but as far as I remember the original issue was about preserving history for some context, not only workspace. See #9019 (comment) for instance. cc @loujaybee I think we should merge it though. |
@iQQBot fyi prebuilds output is relying on HISTFILE env var: https://github.com/gitpod-io/gitpod/blob/7b75c00dd36d3a6286349379a87bc34703c31a07/components/supervisor/pkg/supervisor/tasks.go#LL413C11-L413C19 please make sure to test that we don't cause regressions in this area 🙏 |
yeah, but prebuild can overwrite the env, it use XXX=YYY before command, since it priority is highest. I will double check |
Exactly, so I updated the description to 💯 that this is definitely an improvement. Thanks for getting on this very quickly, @iQQBot! |
@iQQBot would a title like "Persist bash history across workspace restarts" work better? Not sure if the title is too important, but just throwing it out there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tried but look sensible.
please unhold when you are ready
/hold
/unhold If something wrong, we can revert this. |
Description
Related Issue(s)
Relates PRD-59
How to test
repeat these step in different ide, i.e. Jetbrains, ssh, vscode desktop
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options:
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish Options
Installer Options
Add desired feature flags to the end of the line above, space separated
Preview Environment Options:
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
/hold