aboutsummaryrefslogtreecommitdiff
path: root/zsh/zshrc.d
diff options
context:
space:
mode:
Diffstat (limited to 'zsh/zshrc.d')
-rw-r--r--zsh/zshrc.d/keep.zsh4
-rw-r--r--zsh/zshrc.d/prompt.zsh12
2 files changed, 8 insertions, 8 deletions
diff --git a/zsh/zshrc.d/keep.zsh b/zsh/zshrc.d/keep.zsh
index 8a2b9449..36d2f57d 100644
--- a/zsh/zshrc.d/keep.zsh
+++ b/zsh/zshrc.d/keep.zsh
@@ -89,8 +89,8 @@ EOF
case $name in
# NAME must start with letters or an underscore, and contain no
- # characters besides letters, numbers, or underscores
- *[!a-zA-Z0-9_]*|[!a-zA-Z_]*)
+ # characters besides letters, numbers, underscores, or dashes
+ [!a-zA-Z_]*|*[!a-zA-Z0-9_-]*)
printf 'zsh: %s: %s not a valid NAME\n' \
"${FUNCNAME[0]}" "$name" >&2
((errors++))
diff --git a/zsh/zshrc.d/prompt.zsh b/zsh/zshrc.d/prompt.zsh
index 980d8669..245f2973 100644
--- a/zsh/zshrc.d/prompt.zsh
+++ b/zsh/zshrc.d/prompt.zsh
@@ -8,22 +8,23 @@ prompt() {
on)
setopt promptsubst promptpercent
- # Basic prompt shape depends on whether we're in SSH or not
+ # Prompt has hostname via SSH outside of screen/tmux
PS1=
- if [[ -n $SSH_CLIENT || -n $SSH_CONNECTION ]] ; then
+ if [[ -n $SSH_CLIENT && -z $STY && -z $TMUX ]] ; then
PS1=$PS1'%m:'
fi
PS1=$PS1'%~'
- # Add sub-commands; VCS, job, and return status checks
- PS1=$PS1'$(ret=$?;prompt vcs;prompt job;prompt ret)'
-
# Add a helpful prefix if this shell appears to be exotic
case ${SHELL##*/} in
(zsh) ;;
(*) PS1=zsh:$PS1 ;;
esac
+ # Add sub-commands:
+ ## VCS, job, and return status checks as suffixes
+ PS1=$PS1'$(ret=$?;prompt vcs;prompt job;prompt ret)'
+
# Add prefix and suffix
PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}'
@@ -53,7 +54,6 @@ prompt() {
fi
;;
- # Git prompt function
git)
# Wrap as compound command; we don't want to see output from any of