mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Remove function and use os.path.join instead.
This commit is contained in:
parent
be8d423bc4
commit
7733281626
2 changed files with 1 additions and 11 deletions
|
@ -16,7 +16,6 @@ from xonsh.prompt.cwd import (
|
|||
_collapsed_pwd,
|
||||
_replace_home_cwd,
|
||||
_dynamically_collapsed_pwd,
|
||||
_add_dir_slash,
|
||||
)
|
||||
from xonsh.prompt.job import _current_job
|
||||
from xonsh.prompt.env import env_name, vte_new_tab_cwd
|
||||
|
@ -96,7 +95,7 @@ def PROMPT_FIELDS():
|
|||
prompt_end="#" if xt.is_superuser() else "$",
|
||||
hostname=socket.gethostname().split(".", 1)[0],
|
||||
cwd=_dynamically_collapsed_pwd,
|
||||
cwd_dir=lambda: _add_dir_slash(os.path.dirname(_replace_home_cwd())),
|
||||
cwd_dir=lambda: os.path.join(os.path.dirname(_replace_home_cwd()), ""),
|
||||
cwd_base=lambda: os.path.basename(_replace_home_cwd()),
|
||||
short_cwd=_collapsed_pwd,
|
||||
curr_branch=current_branch,
|
||||
|
|
|
@ -89,12 +89,3 @@ def _dynamically_collapsed_pwd():
|
|||
0 : int(target_width) - len(truncature_char)
|
||||
] + truncature_char
|
||||
return full
|
||||
|
||||
|
||||
def _add_dir_slash(cwd_dir):
|
||||
"""Adds a slash to parent directory path where appropriate for aesthetics.
|
||||
Currently used for cwd_dir prompt variable."""
|
||||
if cwd_dir and not cwd_dir.endswith(os.path.sep):
|
||||
return f"{cwd_dir}{os.path.sep}"
|
||||
else:
|
||||
return cwd_dir
|
||||
|
|
Loading…
Add table
Reference in a new issue