From 6dfc9b960f023f30d6c55a22fa8402d91beb8d1f Mon Sep 17 00:00:00 2001 From: Banst Date: Tue, 8 Nov 2022 09:34:13 +0100 Subject: feat(git): display tag in git-prompt when possible (#11318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- lib/git.zsh | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/git.zsh b/lib/git.zsh index be9fa7e67..f049f73c2 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -19,6 +19,7 @@ function git_prompt_info() { local ref ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \ + || ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \ || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \ || return 0 -- cgit v1.2.3-70-g09d2 From 3dd83a22a160249a71631a51490fd3b89d1b3975 Mon Sep 17 00:00:00 2001 From: Lawton Nichols Date: Wed, 11 Jan 2023 10:44:29 -0800 Subject: fix(lib): send carriage return after `title` to fix #11314 (#11315) Window and tab titles are changed by emitting an unprintable escape sequence to the terminal. These escape sequences do not play nicely with the TAB character on multiple terminal emulators--they create un-deletable characters on the first line after command execution. Sending "\r" after changing the window and tab titles allows all characters on the first line to be deleted. Fixes #11314 --- lib/termsupport.zsh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 80ca7ef78..fc1cde55e 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -36,6 +36,8 @@ function title { fi ;; esac + + print -Pn "\r" # move the cursor to the beginning of the line } ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD -- cgit v1.2.3-70-g09d2 From 17ea97332b2f2285e3c2e1a00f6745fb1fe1cec5 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 12 Jan 2023 08:29:00 +0100 Subject: Revert "fix(lib): send carriage return after `title` to fix #11314 (#11315)" This reverts commit 3dd83a22a160249a71631a51490fd3b89d1b3975. See https://github.com/ohmyzsh/ohmyzsh/issues/11314#issuecomment-1379492472 --- lib/termsupport.zsh | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index fc1cde55e..80ca7ef78 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -36,8 +36,6 @@ function title { fi ;; esac - - print -Pn "\r" # move the cursor to the beginning of the line } ZSH_THEME_TERM_TAB_TITLE_IDLE="%15<..<%~%<<" #15 char left truncated PWD -- cgit v1.2.3-70-g09d2 From df658350a38aa73920fdefa5b255f8d7a58d31dc Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sun, 15 Jan 2023 17:11:29 +0100 Subject: fix(clipboard): move wsl detection to higher priority (#11440) Closes #8827 --- lib/clipboard.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index ad83fc4b2..2f3b6bcad 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -57,6 +57,9 @@ function detect-clipboard() { elif [[ "${OSTYPE}" == (cygwin|msys)* ]]; then function clipcopy() { cat "${1:-/dev/stdin}" > /dev/clipboard; } function clippaste() { cat /dev/clipboard; } + elif (( $+commands[clip.exe] )) && (( $+commands[powershell.exe] )); then + function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; } + function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } elif [ -n "${WAYLAND_DISPLAY:-}" ] && (( ${+commands[wl-copy]} )) && (( ${+commands[wl-paste]} )); then function clipcopy() { cat "${1:-/dev/stdin}" | wl-copy &>/dev/null &|; } function clippaste() { wl-paste; } @@ -81,9 +84,6 @@ function detect-clipboard() { elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then function clipcopy() { tmux load-buffer "${1:--}"; } function clippaste() { tmux save-buffer -; } - elif [[ $(uname -r) = *icrosoft* ]]; then - function clipcopy() { cat "${1:-/dev/stdin}" | clip.exe; } - function clippaste() { powershell.exe -noprofile -command Get-Clipboard; } else function _retry_clipboard_detection_or_fail() { local clipcmd="${1}"; shift -- cgit v1.2.3-70-g09d2