mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-14 22:47:45 +08:00
Compare commits
2 Commits
cc5100d1e9
...
82c0db41bc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82c0db41bc | ||
|
|
c189e8b40c |
@ -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
|
||||
16
plugins/term_tab/README.md
Normal file
16
plugins/term_tab/README.md
Normal 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
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user