summary refs log tree commit diff
path: root/bin/dash/src/input.c (follow)
Commit message (Collapse)AuthorAge
* Remove dashJune McEnroe2022-03-15
| | | | Moved to https://git.causal.agency/dash/ and jorts.
* Cache the expanded prompt for editlineJune McEnroe2020-12-23
| | | | | | | | | | | | | | | | | | | Previously, the prompt would be expanded every time editline called the getprompt callback. I think the code may have been written assuming that editline only calls getprompt once per prompt, but it may actually call it many times, for instance every time you type backspace. This results not only in slower editing from expanding complex prompts repeatedly, it also consumes more and more stack memory each time getprompt is called. This can be seen by setting PS1 to some command substitution, typing many characters at the prompt, then holding backspace and observing memory usage. Thankfully all this stack memory is freed between prompts by the stackmark calls around el_gets. This change causes prompt expansion to always happen in the setprompt call, as it would when editline is disabled, and a cached copy of the prompt is saved for getprompt to return every time editline calls it. Since getprompt is no longer doing expansion, the stackmark calls surrounding el_gets can be removed.
* Merge commit '9e55e38997ed4d6998af9e113e215a926c24988e' as 'bin/dash'June McEnroe2020-12-22
From tag 'v0.5.11.2'.