mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
fixed prompt
This commit is contained in:
parent
06a859aee4
commit
4fac97258c
1 changed files with 6 additions and 7 deletions
|
|
@ -12,6 +12,7 @@ check_ssh() {
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
${optionalString git.enable ''
|
${optionalString git.enable ''
|
||||||
add_icon() {
|
add_icon() {
|
||||||
local icon=$1
|
local icon=$1
|
||||||
|
|
@ -52,7 +53,6 @@ check_venv() {
|
||||||
set_git_dir() {
|
set_git_dir() {
|
||||||
local superproject_root=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
|
local superproject_root=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
|
||||||
if [[ -n "$superproject_root" ]]; then
|
if [[ -n "$superproject_root" ]]; then
|
||||||
# If inside a submodule, display only the root of the parent and the submodule name
|
|
||||||
local submodule_name=$(basename "$git_root")
|
local submodule_name=$(basename "$git_root")
|
||||||
|
|
||||||
working_dir="\[\033[01;34m\] ''${superproject_root##*/}/$submodule_name$git_curr_dir\[\033[00m\]"
|
working_dir="\[\033[01;34m\] ''${superproject_root##*/}/$submodule_name$git_curr_dir\[\033[00m\]"
|
||||||
|
|
@ -98,6 +98,7 @@ function set_prompt() {
|
||||||
local ssh_PS1
|
local ssh_PS1
|
||||||
|
|
||||||
check_ssh
|
check_ssh
|
||||||
|
|
||||||
${optionalString git.enable ''
|
${optionalString git.enable ''
|
||||||
local venv_icons
|
local venv_icons
|
||||||
local git_branch_PS1
|
local git_branch_PS1
|
||||||
|
|
@ -105,12 +106,10 @@ function set_prompt() {
|
||||||
check_project
|
check_project
|
||||||
''}
|
''}
|
||||||
|
|
||||||
|
${if git.enable
|
||||||
${if git.enable then ''
|
then ''PS1="$ssh_PS1\n$working_dir\n$venv_icons$green_arrow$git_branch_PS1$white_text"''
|
||||||
PS1="$ssh_PS1\n$working_dir\n$venv_icons$green_arrow$git_branch_PS1$white_text"
|
else ''PS1="$ssh_PS1\n$working_dir\n$green_arrow$white_text"''
|
||||||
'' else ''
|
}
|
||||||
PS1="$ssh_PS1\n$working_dir\n$green_arrow$white_text"
|
|
||||||
''}
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue