mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
feat(xonsh): add version
This commit is contained in:
parent
d8f1c4c942
commit
16c0ba55bc
|
@ -3,7 +3,7 @@ import uuid
|
||||||
$POWERLINE_COMMAND = "oh-my-posh"
|
$POWERLINE_COMMAND = "oh-my-posh"
|
||||||
$POSH_THEME = "::CONFIG::"
|
$POSH_THEME = "::CONFIG::"
|
||||||
$POSH_PID = uuid.uuid4().hex
|
$POSH_PID = uuid.uuid4().hex
|
||||||
$POSH_SHELL_VERSION = ""
|
$POSH_SHELL_VERSION = $XONSH_VERSION
|
||||||
|
|
||||||
def get_command_context():
|
def get_command_context():
|
||||||
last_cmd = __xonsh__.history[-1] if __xonsh__.history else None
|
last_cmd = __xonsh__.history[-1] if __xonsh__.history else None
|
||||||
|
@ -13,11 +13,11 @@ def get_command_context():
|
||||||
|
|
||||||
def posh_primary():
|
def posh_primary():
|
||||||
status, duration = get_command_context()
|
status, duration = get_command_context()
|
||||||
return $(::OMP:: print primary --config=@($POSH_THEME) --shell=xonsh --error=@(status) --execution-time=@(duration) | cat)
|
return $(::OMP:: print primary --config=@($POSH_THEME) --shell=xonsh --error=@(status) --execution-time=@(duration) --shell-version=@($POSH_SHELL_VERSION) | cat)
|
||||||
|
|
||||||
def posh_right():
|
def posh_right():
|
||||||
status, duration = get_command_context()
|
status, duration = get_command_context()
|
||||||
return $(::OMP:: print right --config=@($POSH_THEME) --shell=xonsh --error=@(status) --execution-time=@(duration) | cat)
|
return $(::OMP:: print right --config=@($POSH_THEME) --shell=xonsh --error=@(status) --execution-time=@(duration) --shell-version=@($POSH_SHELL_VERSION) | cat)
|
||||||
|
|
||||||
|
|
||||||
$PROMPT = posh_primary
|
$PROMPT = posh_primary
|
||||||
|
|
Loading…
Reference in a new issue