1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-14 22:47:45 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Basil Sh
82c0db41bc
docs(term_tab): rewrite README in markdown (#11381) 2022-12-09 19:11:16 +01:00
Dan Wallis
c189e8b40c
feat(agnoster): add remote-tracking status to prompt (#7209) 2022-12-09 19:10:04 +01:00
3 changed files with 27 additions and 16 deletions

View File

@ -1,16 +0,0 @@
term_tab - 'cwd' for all open zsh sessions
******************************************
What it does:
*************
This plugin allows to complete the 'cwd' of other Zsh sessions. Sounds
complicated but is rather simple. E.g. if you have three zsh sessions open, in
each session you are in a different folder, you can hit Ctrl+v in one session
to show you the current working directory of the other open zsh sessions.
How it works:
*************
* It uses 'pidof zsh' to determine all zsh PIDs
* It reads procfs to get the current working directory of this session
* Everything is fed into zsh's completion magic

View File

@ -0,0 +1,16 @@
# term_tab plugin
term_tab - `cwd` for all open zsh sessions
## What it does:
This plugin allows to complete the `cwd` of other Zsh sessions. Sounds
complicated but is rather simple. E.g. if you have three zsh sessions open, in
each session you are in a different folder, you can hit `Ctrl+V` in one session
to show you the current working directory of the other open zsh sessions.
## How it works:
* It uses `pidof zsh` to determine all zsh PIDs
* It reads procfs to get the current working directory of this session
* Everything is fed into zsh's completion magic

View File

@ -116,6 +116,17 @@ prompt_git() {
prompt_segment green $CURRENT_FG
fi
local ahead behind
ahead=$(git log --oneline @{upstream}.. 2>/dev/null)
behind=$(git log --oneline ..@{upstream} 2>/dev/null)
if [[ -n "$ahead" ]] && [[ -n "$behind" ]]; then
PL_BRANCH_CHAR=$'\u21c5'
elif [[ -n "$ahead" ]]; then
PL_BRANCH_CHAR=$'\u21b1'
elif [[ -n "$behind" ]]; then
PL_BRANCH_CHAR=$'\u21b0'
fi
if [[ -e "${repo_path}/BISECT_LOG" ]]; then
mode=" <B>"
elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then