Skip to content

feat(config): add configurable input_prompt setting#610

Open
hanzpo wants to merge 1 commit into
ulyssa:mainfrom
hanzpo:feat/configurable-input-prompt
Open

feat(config): add configurable input_prompt setting#610
hanzpo wants to merge 1 commit into
ulyssa:mainfrom
hanzpo:feat/configurable-input-prompt

Conversation

@hanzpo

@hanzpo hanzpo commented Apr 21, 2026

Copy link
Copy Markdown

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_prompt string under [settings] that overrides the default lock/unlock emoji prompt in the input area.

  • Unset (default): preserves existing behaviour — 🔒 green for encrypted, 🔓 red for unencrypted, > red for unknown encryption state.
  • Set: the provided string replaces the prompt for all three states.

Example

[settings]
input_prompt = ""

Motivation

When running iamb inside tmux, the default emoji prompt can produce stray characters in the input line that only Ctrl+L clears. tmux capture-pane on the affected region shows a clean logical buffer — the artifact lives at the terminal display layer, caused by disagreement between ratatui's unicode-width, tmux's internal width tables, and the outer terminal's rendering of the lock glyph + U+FE0E variation 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 . --locked builds clean on rust 1.92
  • Default config: emoji prompt + colors render as before
  • With input_prompt = "❯ " in [settings]: single ASCII prompt renders, tmux artifacts disappear
  • config.example.toml updated with a commented example

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.
@VAWVAW

VAWVAW commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Would #581 be a good alternative for this?

If not, please add documentation for the new config option to docs/iamb.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants