Created by: Rycieos
Replace all data sources that use prompt escape codes with actual data. This is prompt mark, digital date, username, and hostname.
Remove backslash escaping from Zsh __lp_escape(). This was added in commit 74e14fe0. I don't understand why, except that maybe a single backslash display would look like an escape code for a control character, like \n
. But that is not the case for Bash, so why the difference?
Zsh only uses percents (%) to escape things in the prompt, where Bash only uses bashslashes. This changes makes the same input string print the same way in the prompt for both shells.
Add Title command feature. This needed to rework how the runtime feature was handled, since it monopolized the DEBUG trap in Bash. Now it can handle multiple features that need to run after the user has submitted the command, but before it runs.
The feature itself is simple: lookup the latest command in the history, and print the normal title postpended by that command to the screen, formatted as a terminal title. Note that Bash's $BASH_COMMAND
is not great, as it only contains the current command, not the whole command line.
Add raw string passing to fix title issues. The problem is simple enough: the extra backslashes or percents that __lp_escape() adds show up in the title, as the title is changed in the previous commit to no longer be printed as part of PS1. Add a "raw" copy of the data strings for username, hostname, and current path with no color or shell character escaping. This is designed for putting into the terminal title, but it could also be used for comparisons. lp_path_format() already had a no formatting return var in lp_path, but now it is not shell escaped.
The title is changed from duplicating the prompt to instead showing just the core bits in the central brackets: username, hostname, current path, followed by the prompt mark. As well as the user prefix, postfix, and MARK_PREFIX. This is a change from the long standing default, but it is customizable both by themes and users, and I have long seen complaints of the current title layout being less than helpful.
Resolves #651 (closed), resolves #609 (closed), resolves #281 (closed)