charmbracelet / charmbracelet/bubbles
When prompting for a password, properly inform the terminal
- Dominant language
- Go
- Stars
- 8.9k
- Forks
- 457
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 5
Description
**Is your feature request related to a problem? Please describe.**
Some terminals like ghostty or iTerm have specific security features when they identify that a password is being requested.
See https://github.com/ghostty-org/ghostty/discussions/3980. The lock shown in the screencast is the goal of this feature request (it prevent focus stealing I think).
**Describe the solution you'd like**
Either adjust the `textinput` or create a new `passwordinput` package to handle this usecase.
**Describe alternatives you've considered**
Manually performing the right syscalls (using `unix.IoctlSetTermios` to set `ICANON` maybe?).
**Additional context**
https://github.com/ghostty-org/ghostty/blob/1805a9cb87aa08a721575842389e426e15bbada2/src/termio/Exec.zig#L364-L366
```zig
// We assume we're in some sort of password input if we're
// in canonical mode and not echoing. This is a heuristic.
const password_input = mode.canonical and !mode.echo;
```
Contributor guide
Assessment
This issue has not been assessed yet.