Yet another powerline theme for xonsh with async prompt support.
This depends on xonsh's unreleased version (master branch will work. or in future >0.9.24)
- It uses
$PROMPT_FIELDS
and no need to have a separate functions and renderer. Since the addition of$PROMPT_TOKENS_FORMATTER
it is possible to use the existing set of functions to emulate powerline theme for xonsh prompts. - Async prompt mode works as well.
To install use pip:
xpip install xontrib-powerline3
# or: xpip install -U git+https://github.com/jnoortheen/xontrib-powerline3
xontrib load powerline3
# these are the default colors and they are configurable.
$PROMPT_FIELD_COLORS = {
"cwd": ("WHITE", "CYAN"),
"gitstatus": ("WHITE", "BLACK"),
"ret_code": ("WHITE", "RED"),
"full_env_name": ("white", "green"),
"hostname": ("white", BLUE),
"localtime": ("#DAF7A6", "black"),
}
# choose the powerline glyph used
$POWERLINE_MODE = "powerline" # if not set then it will choose random
# available modes: round/down/up/flame/squares/ruiny/lego
# define the prompts using the format style and you are good to go
$PROMPT = "".join(
[
"{vte_new_tab_cwd}",
"{cwd:{}}",
"{gitstatus:๎ {}}",
"{ret_code}",
"{background_jobs}",
os.linesep,
"{full_env_name: ๐{}}",
"$",
]
)
$RIGHT_PROMPT = "".join(
(
"{long_cmd_duration: โ{}}",
"{user: ๐ค{}}",
"{hostname: ๐ฅ{}}",
"{localtime: ๐ฐ{}}",
)
)
- When the
env_name
is.venv
show the name of the parent folder- contains
-py3.*
(when it is poetry created) shows the project name part alone
- show number of running background jobs
- show python package
name-version
if current directory has poetry-pyproject.toml
This package was created with xontrib cookiecutter template.