Code Monkey home page Code Monkey logo

xontrib-prompt-bar's People

Contributors

anki-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bglopez playfloor

xontrib-prompt-bar's Issues

Creating a field from env var

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.

Add gitstatus to the right side

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

Fix gitstatus

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.