feat: make bash command display length adapt to terminal width#550
Closed
li0near wants to merge 1 commit into
Closed
feat: make bash command display length adapt to terminal width#550li0near wants to merge 1 commit into
li0near wants to merge 1 commit into
Conversation
Previously, bash commands in the tools activity line were hardcoded to truncate at 30 characters, which often cut off useful context. This change makes the truncation dynamic based on the terminal width (via $COLUMNS), so wider terminals show more of the command. Additionally, a new `display.toolTargetMaxLength` config option is added: - 0 (default): auto-detect from terminal width - Any positive number: use that as the max character length The path truncation in the tools line renderer also respects this config, falling back to terminal-width-based auto-sizing.
Owner
|
Thanks for the PR. This is superseded by #571, which merged configurable tool-name length and safer render-time wrapping. This branch also expands transcript-derived Bash targets using env-derived width and exposes longer untrusted command text on the tools line, which is too risky for the hot statusline path. |
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
Bash commands in the tools activity line were hardcoded to truncate at 30 characters, which often cuts off useful context (e.g.,
git commit -m "Fix auth...instead of the full command).This PR:
$COLUMNS), so wider terminals show more of the commanddisplay.toolTargetMaxLengthconfig option for explicit control:0(default): auto-detect from terminal widthtools-line.tsto also respect this configConfig example
{ "display": { "toolTargetMaxLength": 80 } }Or set to
0(default) to auto-fit to terminal width.Test plan
tsc