feat(config): add configurable input_prompt setting#610
Open
hanzpo wants to merge 1 commit into
Open
Conversation
Add an optional `input_prompt` string under [settings] that overrides the default lock/unlock emoji prompt in the input area. When unset, preserve existing behaviour (U+1F512 green for encrypted, U+1F513 red for unencrypted, `> ` red for unknown). When set, use the provided string for all three states. The default emoji prompt can produce stray characters in the input line when iamb runs inside tmux, because ratatui's unicode-width, tmux's internal width tables, and the outer terminal's emoji rendering do not always agree on the width of the lock glyph plus variation selector. An ASCII override avoids the width mismatch without changing defaults.
Contributor
|
Would #581 be a good alternative for this? If not, please add documentation for the new config option to |
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.
when running in tmux, the default 🔒/🔓 encryption indicators didnt work properly for me and displayed a comma then a closing parenthesis. i just added the ability to override the input prompt.
SUMMARY BELOW IS AI GENERATED
Summary
Adds an optional
input_promptstring under[settings]that overrides the default lock/unlock emoji prompt in the input area.>red for unknown encryption state.Example
Motivation
When running iamb inside tmux, the default emoji prompt can produce stray characters in the input line that only
Ctrl+Lclears.tmux capture-paneon the affected region shows a clean logical buffer — the artifact lives at the terminal display layer, caused by disagreement between ratatui'sunicode-width, tmux's internal width tables, and the outer terminal's rendering of the lock glyph +U+FE0Evariation selector. Not configurable at either end.An ASCII override sidesteps the width mismatch while leaving the emoji prompt intact for users who aren't affected.
Test plan
cargo install --path . --lockedbuilds clean on rust 1.92input_prompt = "❯ "in[settings]: single ASCII prompt renders, tmux artifacts disappearconfig.example.tomlupdated with a commented example