0664370f80a6a3c80686a427bdc6226822bb5408
- Author
- Fredrik Appelberg <fredrik.appelberg@scanpix.se>
- Committer
- Fredrik Appelberg <fredrik.appelberg@scanpix.se>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/.gitignore b/.gitignore
2index 8d19d100c593afe9d4524f55b84c4b6c45eafbbd..2cf59326973364d355e8f91916907dcc781b292c 100644
3--- a/.gitignore
4+++ b/.gitignore
5@@ -2,4 +2,5 @@ locals.zsh
6 log/.zsh_history
7 projects.zsh
8 custom/*
9-!custom/example.zsh
10+!custom/example.zshcache
11+cache/
12diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh
13index abd0da1850e0c92af8c1f30bf056c2673bf21fa1..e8af2f49d5d2f87daeae99b23d59fecdc7b44d26 100644
14--- a/plugins/mvn/mvn.plugin.zsh
15+++ b/plugins/mvn/mvn.plugin.zsh
16@@ -1,6 +1,6 @@
17 function listMavenCompletions {
18 reply=(
19diff --git a/plugins/screen/screen.plugin.zsh b/plugins/screen/screen.plugin.zsh
20new file mode 100644
21index 0000000000000000000000000000000000000000..ba7ac67e71e6f3b2bb000d4e39e94ca8a2c10e4c
22--- /dev/null
23+++ b/plugins/screen/screen.plugin.zsh
24@@ -0,0 +1,54 @@
25+# if using GNU screen, let the zsh tell screen what the title and hardstatus
26+# of the tab window should be.
27+if [[ $TERM == "screen" ]]; then
28+ if [[ $_GET_PATH == '' ]]; then
29+ _GET_PATH='echo $PWD | sed "s/^\/Users\//~/;s/^~$USER/~/"'
30+ fi
31+ if [[ $_GET_HOST == '' ]]; then
32+ _GET_HOST='echo $HOST | sed "s/\..*//"'
33+ fi
34+
35+ # use the current user as the prefix of the current tab title
36+ TAB_TITLE_PREFIX='"`'$_GET_HOST'`:`'$_GET_PATH' | sed "s:..*/::"`$PROMPT_CHAR"'
37+ # when at the shell prompt, show a truncated version of the current path (with
38+ # standard ~ replacement) as the rest of the title.
39+ TAB_TITLE_PROMPT='$SHELL:t'
40+ # when running a command, show the title of the command as the rest of the
41+ # title (truncate to drop the path to the command)
42+ TAB_TITLE_EXEC='$cmd[1]:t'
43+
44+ # use the current path (with standard ~ replacement) in square brackets as the
45+ # prefix of the tab window hardstatus.
46+ TAB_HARDSTATUS_PREFIX='"[`'$_GET_PATH'`] "'
47+ # when at the shell prompt, use the shell name (truncated to remove the path to
48+ # the shell) as the rest of the title
49+ TAB_HARDSTATUS_PROMPT='$SHELL:t'
50+ # when running a command, show the command name and arguments as the rest of
51+ # the title
52+ TAB_HARDSTATUS_EXEC='$cmd'
53+
54+ # tell GNU screen what the tab window title ($1) and the hardstatus($2) should be
55+ function screen_set()
56+ {
57+ # set the tab window title (%t) for screen
58+ print -nR $'\033k'$1$'\033'\\\
59+
60+ # set hardstatus of tab window (%h) for screen
61+ print -nR $'\033]0;'$2$'\a'
62+ }
63+ # called by zsh before executing a command
64+ function preexec()
65+ {
66+ local -a cmd; cmd=(${(z)1}) # the command string
67+ eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_EXEC"
68+ eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_EXEC"
69+ screen_set $tab_title $tab_hardstatus
70+ }
71+ # called by zsh before showing the prompt
72+ function precmd()
73+ {
74+ eval "tab_title=$TAB_TITLE_PREFIX:$TAB_TITLE_PROMPT"
75+ eval "tab_hardstatus=$TAB_HARDSTATUS_PREFIX:$TAB_HARDSTATUS_PROMPT"
76+ screen_set $tab_title $tab_hardstatus
77+ }
78+fi