Skip to content

Commit 6e1944b

Browse files
committed
plugins/config: enhance status line with path context and emojis
- Add parent/current directory display with intelligent truncation - Implement dual-tone green color scheme (dark/light) - Add emoji indicators for visual scanning (πŸ“¦ 🧬 πŸ—‚οΈ 🎨 πŸ’¬) - Display path context alongside branch: "parent/current:branch" - Use ${TMPDIR:-/tmp}/claude-sessions for prompt file location - Truncate parent dir to 10 chars, current folder to 20 chars Status line format: πŸ“¦ version | 🧬 model | πŸ—‚οΈ parent/current:branch | 🎨 style | πŸ’¬ prompt
1 parent 8579cb0 commit 6e1944b

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

β€Žplugins/config/scripts/status_line.shβ€Ž

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,53 @@ SESSION_ID=$(echo "$input" | jq -r '.session_id')
1313
# ANSI color codes (matte)
1414
PURPLE='\033[38;5;135m'
1515
BLUE='\033[38;5;68m'
16-
GREEN='\033[38;5;71m'
16+
GREEN_DARK='\033[38;5;28m'
17+
GREEN_LIGHT='\033[38;5;71m'
1718
YELLOW='\033[38;5;179m'
1819
GREY='\033[38;5;245m'
1920
RESET='\033[0m'
2021

21-
# Git branch or current directory
22+
# Git branch or current directory with path context
2223
GIT_INFO=""
23-
if git rev-parse --git-dir > /dev/null 2>&1; then
24+
PARENT_DIR=$(basename "$(dirname "$CURRENT_DIR")")
25+
CURRENT_FOLDER="${CURRENT_DIR##*/}"
26+
27+
# Truncate parent dir to 10 chars, current folder to 20 chars
28+
if [ ${#PARENT_DIR} -gt 10 ]; then
29+
PARENT_DIR="${PARENT_DIR:0:10}"
30+
fi
31+
if [ ${#CURRENT_FOLDER} -gt 20 ]; then
32+
CURRENT_FOLDER="${CURRENT_FOLDER:0:20}"
33+
fi
34+
35+
PATH_CONTEXT="${PARENT_DIR}/${CURRENT_FOLDER}"
36+
37+
if git rev-parse --git-dir >/dev/null 2>&1; then
2438
BRANCH=$(git branch --show-current 2>/dev/null)
2539
if [ -n "$BRANCH" ]; then
26-
GIT_INFO="$BRANCH"
40+
GIT_INFO="${GREEN_DARK}${PATH_CONTEXT}${RESET}:${GREEN_LIGHT}${BRANCH}${RESET}"
2741
else
28-
GIT_INFO="${CURRENT_DIR##*/}"
42+
GIT_INFO="${GREEN_DARK}${PATH_CONTEXT}${RESET}"
2943
fi
3044
else
31-
GIT_INFO="${CURRENT_DIR##*/}"
45+
GIT_INFO="${GREEN_DARK}${PATH_CONTEXT}${RESET}"
3246
fi
3347

3448
# Last prompt (truncate to 50 chars)
3549
LAST_PROMPT=""
36-
PROMPT_FILE="/tmp/prompts-${SESSION_ID}.txt"
50+
PROMPT_FILE="${TMPDIR:-/tmp}/claude-sessions/prompts-${SESSION_ID}.txt"
3751
## Check if file exists for the session.
3852
if [ -f "$PROMPT_FILE" ]; then
3953
## Get the last prompt for the session.
4054
LAST_LINE=$(tail -n 1 "$PROMPT_FILE" 2>/dev/null)
4155
if [ -n "$LAST_LINE" ]; then
4256
## Truncate prompt, if it is longer than 50 chars.
4357
if [ ${#LAST_LINE} -gt 50 ]; then
44-
LAST_PROMPT=" | ${GREY}${LAST_LINE:0:50}...${RESET}"
58+
LAST_PROMPT=" | πŸ’¬ ${GREY}${LAST_LINE:0:50}...${RESET}"
4559
else
46-
LAST_PROMPT=" | ${GREY}${LAST_LINE}${RESET}"
60+
LAST_PROMPT=" | πŸ’¬ ${GREY}${LAST_LINE}${RESET}"
4761
fi
4862
fi
4963
fi
5064

51-
echo -e "${PURPLE}${VERSION}${RESET} | ${BLUE}${MODEL_DISPLAY}${RESET} | ${GREEN}${GIT_INFO}${RESET} | ${YELLOW}${OUTPUT_STYLE}${RESET}${LAST_PROMPT}"
65+
echo -e "πŸ“¦ ${PURPLE}${VERSION}${RESET} | 🧬 ${BLUE}${MODEL_DISPLAY}${RESET} | πŸ—‚οΈ ${GIT_INFO} | 🎨 ${YELLOW}${OUTPUT_STYLE}${RESET}${LAST_PROMPT}"

0 commit comments

Comments
Β (0)