-
-
Notifications
You must be signed in to change notification settings - Fork 799
feat: implement per-block zsh history isolation #3016
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import ( | |
| "github.com/wavetermdev/waveterm/pkg/panichandler" | ||
| "github.com/wavetermdev/waveterm/pkg/telemetry" | ||
| "github.com/wavetermdev/waveterm/pkg/telemetry/telemetrydata" | ||
| "github.com/wavetermdev/waveterm/pkg/util/shellutil" | ||
| "github.com/wavetermdev/waveterm/pkg/util/utilfn" | ||
| "github.com/wavetermdev/waveterm/pkg/waveobj" | ||
| "github.com/wavetermdev/waveterm/pkg/wps" | ||
|
|
@@ -170,6 +171,10 @@ func DeleteBlock(ctx context.Context, blockId string, recursive bool) error { | |
| if err != nil { | ||
| return fmt.Errorf("error deleting block: %w", err) | ||
| } | ||
| // Clean up per-block zsh history directory | ||
| if cleanupErr := shellutil.CleanupBlockZshHistory(blockId); cleanupErr != nil { | ||
| log.Printf("error cleaning up block zsh history for %s: %v\n", blockId, cleanupErr) | ||
| } | ||
|
Comment on lines
+174
to
+177
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Defer block-history cleanup until after shell teardown or merge. Line 175 removes the directory that the live zsh session is using as 🤖 Prompt for AI Agents |
||
| log.Printf("DeleteBlock: parentBlockCount: %d", parentBlockCount) | ||
| parentORef := waveobj.ParseORefNoErr(block.ParentORef) | ||
|
|
||
|
|
||
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.
Gate per-block history here unless non-darwin merge support exists.
This branch now isolates zsh history for every block, but
pkg/util/shellutil/shellutil.gostill makesFixupWaveZshHistory()a no-op whenruntime.GOOS != "darwin". On Linux, those commands never get merged back into~/.zsh_history, so the new history path becomes a dead end. Either scope this behavior to the platforms that already have merge support, or add the same merge path for the other supported zsh platforms.🤖 Prompt for AI Agents