fish: update prompt; don't be fancy in tty

This commit is contained in:
end-4
2026-03-24 14:50:53 +01:00
parent abea376e59
commit 774ce228a0
3 changed files with 61 additions and 33 deletions
+16 -13
View File
@@ -1,28 +1,31 @@
function fish_prompt -d "Write out the prompt" # Commands to run in interactive sessions can go here
# This shows up as USER@HOST /home/user/ >, with the directory colored if status is-interactive
# $USER and $hostname are set by fish, so you can just use them
# instead of using `whoami` and `hostname`
printf '%s@%s %s%s%s > ' $USER $hostname \
(set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end
if status is-interactive # Commands to run in interactive sessions can go here
# No greeting # No greeting
set fish_greeting set fish_greeting
# Use starship # Use starship
starship init fish | source function starship_transient_prompt_func
starship module character
end
if test "$TERM" != "linux"
starship init fish | source
enable_transience
end
# Colors
if test -f ~/.local/state/quickshell/user/generated/terminal/sequences.txt if test -f ~/.local/state/quickshell/user/generated/terminal/sequences.txt
cat ~/.local/state/quickshell/user/generated/terminal/sequences.txt cat ~/.local/state/quickshell/user/generated/terminal/sequences.txt
end end
# Aliases # Aliases
alias clear "printf '\033[2J\033[3J\033[1;1H'" # fix: kitty doesn't clear properly # kitty doesn't clear properly so we need to do this weird printing
alias clear "printf '\033[2J\033[3J\033[1;1H'"
alias celar "printf '\033[2J\033[3J\033[1;1H'" alias celar "printf '\033[2J\033[3J\033[1;1H'"
alias claer "printf '\033[2J\033[3J\033[1;1H'" alias claer "printf '\033[2J\033[3J\033[1;1H'"
alias ls 'eza --icons'
alias pamcan pacman alias pamcan pacman
alias q 'qs -c ii' alias q 'qs -c ii'
if test "$TERM" != "linux"
alias ls 'eza --icons'
end
end end
@@ -23,5 +23,27 @@ cursor #$term7 #
foreground #$term7 # foreground #$term7 #
selection_background #$term7 # selection_background #$onSecondaryContainer #
selection_foreground #$term0 # selection_foreground #$secondaryContainer #
# Override obscure colors for starship prompt (these are greys at the end)
color255 #$primary #
color254 #$primaryContainer #
color253 #$secondary #
color252 #$secondaryContainer #
color251 #$tertiary #
color250 #$tertiaryContainer #
color249 #$error #
color248 #$errorContainer #
color232 #$onPrimary #
color233 #$onPrimaryContainer #
color234 #$onSecondary #
color235 #$onSecondaryContainer #
color236 #$onTertiary #
color237 #$onTertiaryContainer #
color238 #$onError #
color239 #$onErrorContainer #
color244 #$outline #
color245 #$outlineVariant #
+21 -18
View File
@@ -7,28 +7,31 @@ add_newline = false
# Cool stuff 󰜥    # Cool stuff 󰜥   
# format = """ # format = """
# $cmd_duration$username$hostname $directory $git_branch # $directory $fill $git_branch $cmd_duration
# $character # $character"""
# """
format = """ format = """
$cmd_duration 󰜥 $directory $git_branch $cmd_duration $directory$git_branch
$character""" $character"""
[fill]
symbol = '-'
style = 'fg:245'
# Replace the "" symbol in the prompt with "➜" # Replace the "" symbol in the prompt with "➜"
[character] # The name of the module we are configuring is "character" [character] # The name of the module we are configuring is "character"
success_symbol = "[  ](bold fg:blue)" success_symbol = "[ ](bold fg:255)"
error_symbol = "[  ](bold fg:red)" error_symbol = "[ ](bold fg:249)"
# Disable the package module, hiding it from the prompt completely # Disable the package module, hiding it from the prompt completely
[package] [package]
disabled = true disabled = true
[git_branch] [git_branch]
style = "bg: cyan" style = "bg: 252"
symbol = "󰘬" symbol = "󰘬"
truncation_length = 12 truncation_length = 12
truncation_symbol = "" truncation_symbol = ""
format = "󰜥 [](bold fg:cyan)[$symbol $branch(:$remote_branch)](fg:black bg:cyan)[ ](bold fg:cyan)" format = " 󰜥 [](bold fg:252)[$symbol $branch(:$remote_branch)](fg:235 bg:252)[ ](bold fg:252)"
[git_commit] [git_commit]
commit_hash_length = 4 commit_hash_length = 4
@@ -52,7 +55,7 @@ deleted = " 🗑 "
[hostname] [hostname]
ssh_only = false ssh_only = false
format = "[•$hostname](bg:cyan bold fg:black)[](bold fg:cyan)" format = "[•$hostname](bg:252 bold fg:235)[](bold fg:252)"
trim_at = ".companyname.com" trim_at = ".companyname.com"
disabled = false disabled = false
@@ -71,19 +74,19 @@ format = '🕙[\[ $time \]]($style) '
time_format = "%T" time_format = "%T"
[username] [username]
style_user = "bold bg:cyan fg:black" style_user = "bold bg:252 fg:235"
style_root = "red bold" style_root = "red bold"
format = "[](bold fg:cyan)[$user]($style)" format = "[](bold fg:252)[$user]($style)"
disabled = false disabled = false
show_always = true show_always = true
[directory] [directory]
home_symbol = "  " home_symbol = " "
read_only = "  " read_only = "  "
style = "bg:green fg:black" style = "bg:255 fg:black"
truncation_length = 6 truncation_length = 2
truncation_symbol = " ••/" truncation_symbol = ".../"
format = '[](bold fg:green)[󰉋 $path]($style)[](bold fg:green)' format = '[](bold fg:255)[󰉋 $path]($style)[](bold fg:255)'
[directory.substitutions] [directory.substitutions]
@@ -97,4 +100,4 @@ format = '[](bold fg:green)[󰉋 $path]($style)[](bold fg:green)'
[cmd_duration] [cmd_duration]
min_time = 0 min_time = 0
format = '[](bold fg:yellow)[󰪢 $duration](bold bg:yellow fg:black)[](bold fg:yellow)' format = '[](bold fg:252)[󰪢 $duration](bold bg:252 fg:235)[](bold fg:252)'