From 45528e1e084d11478ee07c9fcd55c3b7455502ac Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Thu, 27 Feb 2025 10:34:00 +0400 Subject: [PATCH] =?UTF-8?q?am=C3=A9liorer=20affichage=20p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/p | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/p b/bin/p index 384f6c4..561d88a 100755 --- a/bin/p +++ b/bin/p @@ -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[@]}"