anki-code / xontrib-prompt-bar Goto Github PK
View Code? Open in Web Editor NEWThe bar prompt for xonsh shell with customizable sections and Starship support.
License: BSD 2-Clause "Simplified" License
The bar prompt for xonsh shell with customizable sections and Starship support.
License: BSD 2-Clause "Simplified" License
/long/long/long/long/long/long/path
-> .../long/path
Start lines -
xontrib-prompt-bar/xontrib/prompt_bar.py
Lines 151 to 152 in fce5308
I have an environment var that I change quite a bit and wanted to have the value show up on the bar, but it doesn't seem to update.
Parts of my ~/.xonshrc
...
$PROMPT_FIELDS['ccloud'] = __xonsh__.env.get("CCLOUD_NAME", None)
$XONTRIB_PROMPT_BAR_RIGHT = '{ccloud#section}{env_name#section}{gitstatus_noc#section}{date_time_tz}'
If source ~/.xonshrc then the value gets updated, but if I just change the env var $CCLOUD_NAME, then it doesn't get updated.
Installed prompt_bar via proper methods, when running I get the following:
$ xontrib load prompt_bar
prompt: error: on field 'prompt_bar'
xonsh: For full traceback set: $XONSH_SHOW_TRACEBACK = True
TypeError: expected string or bytes-like object
{ERROR:prompt_bar}
{ERROR:prompt_bar}
@
Running with traceback enabled gives:
prompt: error: on field 'prompt_bar'
xonsh: To log full traceback to a file set: $XONSH_TRACEBACK_LOGFILE = <filename>
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/xonsh/prompt/__amalgam__.py", line 189, in _get_field_value
return self.fields.pick(field)
File "/usr/lib/python3.10/site-packages/xonsh/prompt/__amalgam__.py", line 434, in pick
value = value()
File "/usr/lib/python3.10/site-packages/xontrib/prompt_bar.py", line 153, in _prompt_bar
rpc = _format_sections(_RIGHT)
File "/usr/lib/python3.10/site-packages/xontrib/prompt_bar.py", line 121, in _format_sections
map[key] = _wrappers[wrapper](map[key])
File "/usr/lib/python3.10/site-packages/xontrib/prompt_bar.py", line 90, in <lambda>
'nocolorx': lambda v: _remove_colors(v),
File "/usr/lib/python3.10/site-packages/xontrib/prompt_bar.py", line 42, in _remove_colors
return re.sub('{([A-Z0-9#_]+?)}', '', s)
File "/usr/lib/python3.10/re.py", line 209, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
{ERROR:prompt_bar}
@
Im not sure what exactly is breaking. Let me know if there is anything else I can provide to help with the issue
gitstatus
option is deprecated:
https://github.com/anki-code/xontrib-prompt-bar/blob/4e8c3763c4c524301265ea773828fa23a3487f3d/xontrib/prompt_bar.py#L15
That's why it's impossible to change theme by following your readme:
https://github.com/anki-code/xontrib-prompt-bar/blob/5dbbebddc4426533ceca21fb7c5af29ec03f3fad/README.md?plain=1#L39
https://github.com/anki-code/xontrib-prompt-bar/blob/5dbbebddc4426533ceca21fb7c5af29ec03f3fad/README.md?plain=1#L61
subj
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.