Add configurable shell-history suppression#91
Merged
Merged
Conversation
why: Let semantic MCP commands inherit a strict startup history default without changing raw terminal input or direct Python call behavior. what: - Resolve and publish LIBTMUX_SUPPRESS_HISTORY for run_command - Keep raw send, batch, and paste input explicit-only - Add MCP, Bash history, instruction-budget, and boundary regression tests
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
==========================================
+ Coverage 85.00% 85.20% +0.19%
==========================================
Files 43 44 +1
Lines 3202 3265 +63
Branches 439 452 +13
==========================================
+ Hits 2722 2782 +60
- Misses 349 352 +3
Partials 131 131 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
why: Let MCP-spawned shells inherit the configured history policy without rewriting launch commands or mutating caller environments. what: - Normalize and merge controls across all four spawn tools - Preserve positional compatibility and tmux environment scope - Cover schemas, conflicts, forwarding, and Bash/Zsh/Fish behavior
why: MCP clients need startup precedence in tool schemas and accurate, value-free guidance when a history setting conflicts. what: - Explain MCP omission, explicit override, and Python defaults - Give shell-specific guidance without reflecting supplied values - Cover transformed schemas and every conflict surface
why: Give operators an accurate user-facing contract for best-effort history controls and the visibility surfaces they do not hide. what: - Document startup precedence, eligible tools, shell caveats, and scope - Add safety and logging boundaries for remaining visibility - Lock stable documentation claims with focused contract tests
why: Server instructions named only run_command even though semantic spawn commands inherit the active shell-history default. what: - Name run_command and spawn inheritance in the active-default sentence - Preserve raw input exclusions and UTF-8 instruction-budget guards
why: Keep the process-environment coverage compatible with tmux 3.2a's minimum pane size. what: - Reuse the verified later pane for the respawn assertions - Avoid creating a fifth pane in the fixture window
why: Describe both accepted respawn environment representations and their distinct audit summaries. what: - Explain per-key redaction for mapping input - Explain scalar redaction for JSON object strings
why: Prevent caller line breaks from escaping the grouped history event when suppression is enabled. what: - Reject carriage returns and line feeds before tmux resolution - Preserve explicit suppression-off multiline behavior - Document and test the narrowed contract
why: Keep public history and audit claims consistent with the accepted input shapes and source-link policy. what: - Distinguish mapping and JSON-string audit summaries - Link Bash behavior through a version-tagged GitHub mirror - Add documentation contract coverage
why: Semantic commands should avoid shell-history persistence by default while raw input and process spawning remain explicit caller choices. what: - Treat an unset suppression setting as enabled - Transform only the run_command MCP schema default - Document and test command-only inheritance boundaries
why: Distinguish lightweight command-entry suppression from explicit persistent-history controls for newly spawned shells. what: - Rename the spawn-only option to suppress_persistent_history - Keep startup history defaults scoped to semantic commands - Preserve validated environment merging and tmux spawn behavior
why: Distinguish default-on command suppression from explicit spawn-time persistent-history controls. what: - Document command precedence and the multiline opt-out - Explain spawn scope, shell caveats, and visibility boundaries - Lock the public history contract with documentation tests
why: Keep spawn and discovery wording accurate after the default flip. what: - Distinguish command text from tmux environment arguments - Explain Python table and MCP discovery defaults - Lock the clarified wording in documentation tests
why: Keep the public run-and-wait prompt executable when a command has line breaks and the MCP history-suppression default is enabled. what: - Render an explicit suppression opt-out for LF and CR commands - Disclose possible shell-history persistence in multiline recipes - Cover real and escaped line breaks without changing single-line output
why: Spawn environment values cross process-observable surfaces even when the MCP audit record redacts them. what: - Warn create_window and split_window callers in their MCP schema text - Explain tmux argv, child environment, and session-state boundaries - Contract-test client-visible descriptions and central safety guidance
why: Session environment values persist beyond launch and remain visible outside the redacted MCP audit record. what: - Add client-visible argv, session-state, and child-environment guidance - Add an early credential warning to the create-session task page - Contract-test the schema disclosure and task-page placement
why: Repeated safety icons fragment dense explanatory sequences and conflict with the documented role convention. what: - Use toolref for the three reviewed dense tool sequences - Bind role contracts to the exact paragraphs and safety bullet
why: The changelog contract should validate each product feature without coupling assertions to unrelated unreleased entries. what: - Scope history-control assertions to their deliverable blocks - Cover the environment summary and linked safety guidance
why: Give end users one path from default-on command history hygiene to stronger opt-in spawned-shell controls for Bash, Zsh, and Fish. what: - Add a dedicated topic and front-page workflow - Document multiline prompts and scoped spawn environments - Link affected tools and result models at point of use - Move the docs contract to the canonical topic
why: The unreleased changelog should describe the branch in user-facing terms without release ceremony or implementation detail. what: - Separate compatibility, spawned-shell, and environment capabilities - Link migration and safety detail to focused topic guidance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LIBTMUX_SUPPRESS_HISTORY=0|1as a startup default forrun_commandonly, with invalid values failing startup without reflecting configuration contents; keepsuppress_persistent_historyoncreate_session,create_window,split_window, andrespawn_paneexplicit per call and independent of that setting.suppress_historydefault forrun_commandthroughtools/list; explicit per-call values win, and direct Python calls remain default-off.Changes
MCP policy and contract
run_commandand apply precedence as explicit call value, startup setting, thenFalse; spawn tools never inherit it.Spawned shells
HISTFILE, merging Bash'sHISTCONTROL, and enabling Fish private-history variables.create_sessioncontrols in the tmux session environment for future panes; keepcreate_window,split_window, andrespawn_panecontrols scoped to the spawned process.shellandwindow_shelllaunch strings unchanged. An explicitfalseadds no controls but cannot remove controls already inherited from a session, parent process, or startup file.Terminal safety
run_commandevent only when suppression is effective and reject caller-supplied carriage returns or line feeds before tmux receives input; explicitfalsepreserves intentional multiline commands.send_keysand everysend_keys_batchoperation explicit-only so control keys, partial input, literal text, Enter boundaries, and TUI interaction retain their exact bytes.paste_textandpaste_bufferoutside the suppression policy.Documentation and audit behavior
Design decisions
run_commandcalls; spawned-shell controls stay explicit per call, and arbitrary terminal input cannot safely inherit a byte prefix.Test plan
Verification
Closes #90.