![]() The way I have it set up here, the git branch parentheses only appear if you're in a git branch, otherwise it's blank. # Color prompt for gitĪlias branchname="git branch 2>/dev/null | grep '*' | sed 's/* \(.*\)/ $\$GIT_STATUS\$PROMPT_CHAR " I had to do a lot more digging to figure out where the \001 etc. For this reason, use hexadecimal versions \x01 and \x02 instead. Note: If you use bash's printf or echo -e, and if your text has \001 or \002 immediately before a number, you'll hit a bash bug that causes it to eat one digit too many when processing octal escapes – that is, \00142 will be interpreted as octal 014 (followed by ASCII "2"), instead of the correct octal 01 (followed by ASCII "42"). This may be different if you have set the editing mode to Emacs-style, check /etc/inputrc to find out what it really is. So since ASCII 0x01 is Ctrl-A, youd do 'rm VA'. The bash-specific \ are in fact translated to \001 and \002 at y.tab.c:7640. enter a nonprinting character in bash appears to be the same way you enter nonprinting characters in vim: Ctrl-V (character). These also work in any application that uses readline.įrom lib/readline/display.c:243 in bash source code: 243 /* Current implementation:Ģ44 \001 (^A) start non-visible charactersĢ46 all characters except \001 and \002 (following a \001) are copied toĢ47 the returned string all characters except those between \001 and The readline library accepts \001 and \002 (ASCII SOH and STX) as non-printable text delimiters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |