Многострочные команды запутаны в моем PS1

man grep покажет вам флаг -w :

-w, --word-regexp Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore. 

Или придерживаться | egrep -v Jobname в начале вашего конвейера.

0
09.08.2018, 15:15
1 ответ

Решением было изменить:

info=$(__git_info) && printf '\e[30;43m%s' "$info"

от

до

info=$(__git_info) && printf '\1\e[30;43m\2%s' "$info"

Это связано с тем, что bash внутренне заменяет специальные символы подсказок [ и ] на ASCII 1 и 2 перед выполнением моей __функции состояния git _.

0
28.01.2020, 04:15

Теги

Похожие вопросы