mirror of
				https://github.com/dcarrillo/prezto.git
				synced 2025-11-04 12:09:08 +00:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			pull/607-t
			...
			pull/562-i
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					9852150123 | ||
| 
						 | 
					a8c872671c | ||
| 
						 | 
					0ff0ece5e2 | 
@@ -99,14 +99,13 @@ zstyle -e ':completion:*:hosts' hosts 'reply=(
 | 
			
		||||
)'
 | 
			
		||||
 | 
			
		||||
# Don't complete uninteresting users...
 | 
			
		||||
zstyle ':completion:*:*:*:users' ignored-patterns \
 | 
			
		||||
  adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
 | 
			
		||||
  dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
 | 
			
		||||
  hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
 | 
			
		||||
  mailman mailnull mldonkey mysql nagios \
 | 
			
		||||
  named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
 | 
			
		||||
  operator pcap postfix postgres privoxy pulse pvm quagga radvd \
 | 
			
		||||
  rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs '_*'
 | 
			
		||||
zstyle ':completion:*:*:*:users' ignored-patterns nobody nobody4 noaccess '_*' \
 | 
			
		||||
  $([[ "$OSTYPE" = SunOS ]] && uid_min=100 || uid_min=500
 | 
			
		||||
    IFS=:
 | 
			
		||||
    while read -r user pass uid remainder; do
 | 
			
		||||
      [[ "$user" != (\#*|root) ]] && ((uid < uid_min)) && echo $user
 | 
			
		||||
    done </etc/passwd
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
# ... unless we really want to.
 | 
			
		||||
zstyle '*' single-ignored show
 | 
			
		||||
 
 | 
			
		||||
@@ -348,13 +348,13 @@ function git-info {
 | 
			
		||||
    # Format added.
 | 
			
		||||
    if (( added > 0 )); then
 | 
			
		||||
      zstyle -s ':prezto:module:git:info:added' format 'added_format'
 | 
			
		||||
      zformat -f added_formatted "$added_format" "a:$added"
 | 
			
		||||
      zformat -f added_formatted "$added_format" "a:$added_format"
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    # Format deleted.
 | 
			
		||||
    if (( deleted > 0 )); then
 | 
			
		||||
      zstyle -s ':prezto:module:git:info:deleted' format 'deleted_format'
 | 
			
		||||
      zformat -f deleted_formatted "$deleted_format" "d:$deleted"
 | 
			
		||||
      zformat -f deleted_formatted "$deleted_format" "d:$deleted_format"
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    # Format modified.
 | 
			
		||||
 
 | 
			
		||||
@@ -16,12 +16,9 @@ elif (( $+commands[pyenv] )); then
 | 
			
		||||
  eval "$(pyenv init -)"
 | 
			
		||||
 | 
			
		||||
# Prepend PEP 370 per user site packages directory, which defaults to
 | 
			
		||||
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. The
 | 
			
		||||
# path can be overridden using PYTHONUSERBASE.
 | 
			
		||||
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH.
 | 
			
		||||
else
 | 
			
		||||
  if [[ -n "$PYTHONUSERBASE" ]]; then
 | 
			
		||||
    path=($PYTHONUSERBASE/bin $path)
 | 
			
		||||
  elif [[ "$OSTYPE" == darwin* ]]; then
 | 
			
		||||
  if [[ "$OSTYPE" == darwin* ]]; then
 | 
			
		||||
    path=($HOME/Library/Python/*/bin(N) $path)
 | 
			
		||||
  else
 | 
			
		||||
    # This is subject to change.
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ fi
 | 
			
		||||
# Auto Start
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
if [[ -z "$STY" && -z "$EMACS" && -z "$VIM" ]] && ( \
 | 
			
		||||
if [[ -z "$STY" && ( -z "$INSIDE_EMACS" || -z "$EMACS" || -z "$VIM" ) ]] && ( \
 | 
			
		||||
  ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' remote ) ||
 | 
			
		||||
  ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:screen:auto-start' local ) \
 | 
			
		||||
); then
 | 
			
		||||
 
 | 
			
		||||
@@ -20,19 +20,12 @@ following line to *zpreztorc*:
 | 
			
		||||
 | 
			
		||||
    zstyle ':prezto:module:tmux:auto-start' remote 'yes'
 | 
			
		||||
 | 
			
		||||
In both cases, it will create a background session named _prezto_ if the tmux
 | 
			
		||||
server is not started.
 | 
			
		||||
In both cases, it will create a background session named _#Prezto_ and attach
 | 
			
		||||
every new shell to it.
 | 
			
		||||
 | 
			
		||||
You can change the default session name with:
 | 
			
		||||
 | 
			
		||||
    zstyle ':prezto:module:tmux' session 'YOUR DEFAULT SESSION NAME'
 | 
			
		||||
 | 
			
		||||
With `auto-start` enabled, you may want to control how multiple sessions are
 | 
			
		||||
managed. The `destroy-unattached` option of tmux controls if the unattached
 | 
			
		||||
sessions must be kept alive, making sessions available for later use, configured
 | 
			
		||||
in *tmux.conf*:
 | 
			
		||||
 | 
			
		||||
    set-option -g destroy-unattached [on | off]
 | 
			
		||||
To avoid keeping open sessions, this module sets `destroy-unattached off` on
 | 
			
		||||
the background session and `destroy-unattached on` on every other session
 | 
			
		||||
(global setting).
 | 
			
		||||
 | 
			
		||||
Aliases
 | 
			
		||||
-------
 | 
			
		||||
@@ -61,7 +54,6 @@ Authors
 | 
			
		||||
  - [Sorin Ionescu](https://github.com/sorin-ionescu)
 | 
			
		||||
  - [Colin Hebert](https://github.com/ColinHebert)
 | 
			
		||||
  - [Georges Discry](https://github.com/gdiscry)
 | 
			
		||||
  - [Xavier Cambar](https://github.com/xcambar)
 | 
			
		||||
 | 
			
		||||
[1]: http://tmux.sourceforge.net
 | 
			
		||||
[2]: https://github.com/sorin-ionescu/prezto/issues/62
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,6 @@
 | 
			
		||||
#   Sorin Ionescu <sorin.ionescu@gmail.com>
 | 
			
		||||
#   Colin Hebert <hebert.colin@gmail.com>
 | 
			
		||||
#   Georges Discry <georges@discry.be>
 | 
			
		||||
#   Xavier Cambar <xcambar@gmail.com>
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
# Return if requirements are not found.
 | 
			
		||||
@@ -17,22 +16,31 @@ fi
 | 
			
		||||
# Auto Start
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
if [[ -z "$TMUX" && -z "$EMACS" && -z "$VIM" ]] && ( \
 | 
			
		||||
if [[ -z "$TMUX" && ( -z "$INSIDE_EMACS" || -z "$EMACS" || -z "$VIM" ) ]] && ( \
 | 
			
		||||
  ( [[ -n "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' remote ) ||
 | 
			
		||||
  ( [[ -z "$SSH_TTY" ]] && zstyle -t ':prezto:module:tmux:auto-start' local ) \
 | 
			
		||||
); then
 | 
			
		||||
  tmux_session='prezto'
 | 
			
		||||
 | 
			
		||||
  if ! tmux has-session -t "$tmux_session" 2> /dev/null; then
 | 
			
		||||
    # Ensure that tmux server is started.
 | 
			
		||||
    tmux start-server
 | 
			
		||||
 | 
			
		||||
  # Create a 'prezto' session if no session has been defined in tmux.conf.
 | 
			
		||||
  if ! tmux has-session 2> /dev/null; then
 | 
			
		||||
    zstyle -s ':prezto:module:tmux' session 'session' || session='prezto'
 | 
			
		||||
    tmux \
 | 
			
		||||
      new-session -d -s "$session" \; \
 | 
			
		||||
      set-option -t "$session" destroy-unattached off &> /dev/null
 | 
			
		||||
    # Disable the destruction of unattached sessions globally.
 | 
			
		||||
    tmux set-option -g destroy-unattached off &> /dev/null
 | 
			
		||||
 | 
			
		||||
    # Create a new session.
 | 
			
		||||
    tmux new-session -d -s "$tmux_session"
 | 
			
		||||
 | 
			
		||||
    # Disable the destruction of the new, unattached session.
 | 
			
		||||
    tmux set-option -t "$tmux_session" destroy-unattached off &> /dev/null
 | 
			
		||||
 | 
			
		||||
    # Enable the destruction of unattached sessions globally to prevent
 | 
			
		||||
    # an abundance of open, detached sessions.
 | 
			
		||||
    tmux set-option -g destroy-unattached on &> /dev/null
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  # Attach to the 'prezto' session or to the last session used.
 | 
			
		||||
  exec tmux attach-session
 | 
			
		||||
  exec tmux new-session -t "$tmux_session"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -152,3 +152,4 @@ zstyle ':prezto:module:prompt' theme 'sorin'
 | 
			
		||||
 | 
			
		||||
# Auto start a session when Zsh is launched in a SSH connection.
 | 
			
		||||
# zstyle ':prezto:module:tmux:auto-start' remote 'yes'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user