améliorer affichage p

This commit is contained in:
Jephté Clain 2025-02-27 10:34:00 +04:00
parent c99f80b52a
commit 45528e1e08

8
bin/p
View File

@ -7,7 +7,9 @@ function git_status() {
local status r cwd
status="$(git -c color.status=always status "$@" 2>&1)"; r=$?
if [ -n "$status" ]; then
setx cwd=ppath2 "$(pwd)" "$OrigCwd"
cwd="$Cwd"
[ -n "$cwd" ] || cwd="$(pwd)"
setx cwd=ppath2 "$cwd" "$OrigCwd"
etitle "$cwd"
if [ $r -eq 0 ]; then
echo "$status"
@ -35,6 +37,7 @@ if [ -n "$chdir" ]; then
cd "$chdir" || die
fi
Cwd=
if [ -n "$all" ]; then
# liste de sous répertoires
if [ $# -gt 0 ]; then
@ -55,6 +58,9 @@ if [ -n "$all" ]; then
done
else
# répertoire courant uniquement
setx toplevel=git_get_toplevel
[ -n "$toplevel" ] && Cwd="$toplevel"
args=()
isatty || args+=(--porcelain)
git_status "${args[@]}"