editline icon indicating copy to clipboard operation
editline copied to clipboard

Request for \1 and \2 (RL_PROMPT_START_IGNORE, RL_PROMPT_END_IGNORE) support

Open Artoria2e5 opened this issue 3 years ago • 1 comments

Editline currently uses a "one byte per column" heuristic, and one way that breaks down is when it encounters colored prompts. The way readline (and libedit) handles this issue is by having the program tell it what parts of the prompt don't count into the width calculation: \1 (RL_PROMPT_START_IGNORE) starts the width-ignore area and \2 (RL_PROMPT_END_IGNORE) ends it.

See https://github.com/cdesjardins/libedit/search?q=RL_PROMPT_START_IGNORE for how it works in NetBSD libedit.

Artoria2e5 avatar Apr 19 '21 03:04 Artoria2e5

Pull requests are welcome.

troglobit avatar Apr 19 '21 17:04 troglobit