Skip to content

Commit

Permalink
Shorten pwd on startship windows title
Browse files Browse the repository at this point in the history
  • Loading branch information
hanoii committed Apr 5, 2024
1 parent fbdac23 commit 86e70c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .ddev/addon-metadata/pimp-my-shell/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: pimp-my-shell
repository: .
version: ""
install_date: "2024-04-05T09:20:34-03:00"
install_date: "2024-04-05T11:16:13-03:00"
project_files:
- web-build/Dockerfile.pimp-my-shell
- homeadditions/.bashrc.d/pimp-my-shell.sh
Expand Down
5 changes: 4 additions & 1 deletion .ddev/homeadditions/.bashrc.d/pimp-my-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ fi

# starship prompt
function set_win_title(){
echo -ne "\033]0; ddev[$DDEV_PROJECT]@$PWD - $@\007"
# Shortening $PWD
# /var/www/html -> /v/w/html
local short_pwd=$(echo "$PWD" | sed 's/\([^\/]\)[^\/]*\//\1\//g')
echo -ne "\033]0; ddev[$DDEV_PROJECT]@$short_pwd - $@\007"
}
starship_precmd_user_func="set_win_title"
eval "$(starship init bash)"
Expand Down
5 changes: 4 additions & 1 deletion homeadditions/.bashrc.d/pimp-my-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ fi

# starship prompt
function set_win_title(){
echo -ne "\033]0; ddev[$DDEV_PROJECT]@$PWD - $@\007"
# Shortening $PWD
# /var/www/html -> /v/w/html
local short_pwd=$(echo "$PWD" | sed 's/\([^\/]\)[^\/]*\//\1\//g')
echo -ne "\033]0; ddev[$DDEV_PROJECT]@$short_pwd - $@\007"
}
starship_precmd_user_func="set_win_title"
eval "$(starship init bash)"
Expand Down

0 comments on commit 86e70c7

Please sign in to comment.