charmbracelet / charmbracelet/bubbles
Option to disable word-based line wrapping in text area
- 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.**
I have started using the text area component in my new password manager, [pago](https://github.com/dbohdan/pago). The text area applies whole-word line wrapping. If one character of the word exceeds the line width, the word is wrapped to the next line. This is common and useful for writing prose but not normally used for text-based data. It means long cryptographic tokens like the keys in the following example aren't wrapped at all. I'll illustrate this with screenshots below.
```
# created: 2024-12-18T06:42:28+00:00
# public key: age1n207up3rglzp87mwgu03ne3m4uzdxasynrqpgxwcwa5tsfvlpf2qsrfhaj
AGE-SECRET-KEY-1Z9ZU8AHM3LW4PQG8FX03TWUHFAMQYUGU0ZTWMN2787CD29D0KV9SX4H6WH
```
**Describe the solution you'd like**
I would like a setting to switch from whole-word line wrapping to breaking the word on any character the way code editors do.
**Describe alternatives you've considered**
The alternatives are to leave things as they are (this isn't a deal-breaker), fork the text area component, or replace it.
**Additional context**
Here is how the wrapping mechanism normally works.

The last word gets wrapped after you add one more space.

Here is how it fails with a long [age](https://github.com/FiloSottile/age) private key.

The user presses Space, and the whole token is shifted down one line.

Contributor guide
Assessment
This issue has not been assessed yet.