Skip to content

powerline integration for prompt PS1, variable $o#3294

Open
viklequick wants to merge 6 commits intoelfmz:masterfrom
viklequick:powerline-integration
Open

powerline integration for prompt PS1, variable $o#3294
viklequick wants to merge 6 commits intoelfmz:masterfrom
viklequick:powerline-integration

Conversation

@viklequick
Copy link
Copy Markdown
Contributor

@viklequick viklequick commented Mar 9, 2026

powerline integration for prompt PS1, variable $o

image

and prompt becomes fancy and modern:

image

Technically, powerline is a daemon that works in userspace and listens commands on unix socket. So, it is really cheap to connect to int and ask for colorful command line (left part). Depending on the theme and config, powerline is able to show branches, jobs etc.

@elfmz
Copy link
Copy Markdown
Owner

elfmz commented Mar 15, 2026

1 I think its better to make optional
2 Is it possible to reuse existing code that parses color sequences? See FontState in console/AnsiEsc.hpp

@viklequick
Copy link
Copy Markdown
Contributor Author

1 I think its better to make optional

Looks like it is already optional, to use it you need to specify proper prompt ($o instead of standard $p) to let it work.

Perhaps you mean the additional guard checkbox might be necessary?

Если надо, я могу добавить еще опцию. Так-то оно пока руками не настроишь -- не будет использовать...

FontState in console/AnsiEsc.hpp

I've tried it with no luck. In many cases it returned me empty line. Maybe I've used it wrongly, but I've found only few usages and it seems it needs an specific context. So, as I just needed two ascii codes (256 color setup and rgb color setup) I've created it as separate code.

Я пробовал использовать, но оно как-то странно работало - возвращало мне пустую строку вместо текста. Вероятно, я неверно использовал. Поскольку же все что мне было надо, так это вытащить команду установки цвета, то я нарисовал этот кусочек отдельно. Надо было распарсить только два esc кода (для палитры в 256 цветов и для RGB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants