-
Notifications
You must be signed in to change notification settings - Fork 425
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. The fix is not so simple. This patch adds "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. There is one small issue though: to prevent LP_PS1_PREFIX, LP_PS1_POSTFIX, and LP_MARK_PREFIX that have color from messing up the title, the whole title string is still passed into lp_formatted_title() to strip color out. This is less than ideal, but faster than treating those 3 variables by themselves.
- Loading branch information
Showing
4 changed files
with
51 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters