mirror of
				https://github.com/dcarrillo/prezto.git
				synced 2025-11-04 13:19:09 +00:00 
			
		
		
		
	Compare commits
	
		
			6 Commits
		
	
	
		
			pull/562-i
			...
			pull/582-t
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					5e6adf89b9 | ||
| 
						 | 
					bf9dbfd5b9 | ||
| 
						 | 
					ff0dfa424d | ||
| 
						 | 
					fedad8e9cf | ||
| 
						 | 
					478653fab2 | ||
| 
						 | 
					10cf701864 | 
@@ -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_format"
 | 
			
		||||
      zformat -f added_formatted "$added_format" "a:$added"
 | 
			
		||||
    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_format"
 | 
			
		||||
      zformat -f deleted_formatted "$deleted_format" "d:$deleted"
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    # Format modified.
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,12 @@ 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.
 | 
			
		||||
# ~/Library/Python on Mac OS X and ~/.local elsewhere, to PATH. The
 | 
			
		||||
# path can be overridden using PYTHONUSERBASE.
 | 
			
		||||
else
 | 
			
		||||
  if [[ "$OSTYPE" == darwin* ]]; then
 | 
			
		||||
  if [[ -n "$PYTHONUSERBASE" ]]; then
 | 
			
		||||
    path=($PYTHONUSERBASE/bin $path)
 | 
			
		||||
  elif [[ "$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 "$INSIDE_EMACS" || -z "$EMACS" || -z "$VIM" ) ]] && ( \
 | 
			
		||||
if [[ -z "$STY" && -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,12 +20,25 @@ following line to *zpreztorc*:
 | 
			
		||||
 | 
			
		||||
    zstyle ':prezto:module:tmux:auto-start' remote 'yes'
 | 
			
		||||
 | 
			
		||||
In both cases, it will create a background session named _#Prezto_ and attach
 | 
			
		||||
every new shell to it.
 | 
			
		||||
In both cases the tmux server will be started and a background session
 | 
			
		||||
named _prezto_ will be created if a session doesn't already exist.
 | 
			
		||||
 | 
			
		||||
By default every shell shares a set of windows but has an independent
 | 
			
		||||
view. Detaching from one of these sessions removes the view but the
 | 
			
		||||
open windows persist. This is accomplished by setting the
 | 
			
		||||
`destroy-unattached` option to `on` for each session.
 | 
			
		||||
 | 
			
		||||
Some users prefer that all new shells share the same session so that
 | 
			
		||||
the view for each shell is in sync. This useful for advanced users
 | 
			
		||||
that create multiple sessions and want to manually navigate between
 | 
			
		||||
them. To accomplish this behavior set the `mode` option to `shared` in
 | 
			
		||||
*zpreztorc*,
 | 
			
		||||
 | 
			
		||||
    zstyle ':prezto:module:tmux:auto-start' mode shared
 | 
			
		||||
 | 
			
		||||
You can customize the background session by creating a new session in
 | 
			
		||||
your `.tmux.conf` file.
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
-------
 | 
			
		||||
@@ -41,7 +54,7 @@ connected** to be displayed, which can be fixed by installing
 | 
			
		||||
[reattach-to-user-namespace][3], available in [Homebrew][4], and adding the
 | 
			
		||||
following to *tmux.conf*:
 | 
			
		||||
 | 
			
		||||
   set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"
 | 
			
		||||
    set-option -g default-command "reattach-to-user-namespace -l $SHELL -l"
 | 
			
		||||
 | 
			
		||||
Furthermore, tmux is known to cause **kernel panics** on Mac OS X. A discussion
 | 
			
		||||
about this and Prezto has already been [opened][2].
 | 
			
		||||
@@ -54,6 +67,7 @@ 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,6 +5,7 @@
 | 
			
		||||
#   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.
 | 
			
		||||
@@ -16,31 +17,29 @@ fi
 | 
			
		||||
# Auto Start
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
if [[ -z "$TMUX" && ( -z "$INSIDE_EMACS" || -z "$EMACS" || -z "$VIM" ) ]] && ( \
 | 
			
		||||
if [[ -z "$TMUX" && -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'
 | 
			
		||||
  tmux start-server
 | 
			
		||||
 | 
			
		||||
  if ! tmux has-session -t "$tmux_session" 2> /dev/null; then
 | 
			
		||||
    # Ensure that tmux server is started.
 | 
			
		||||
    tmux start-server
 | 
			
		||||
 | 
			
		||||
    # 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
 | 
			
		||||
  # Create a 'prezto' session if no session has been defined in tmux.conf.
 | 
			
		||||
  if ! tmux has-session 2> /dev/null; then
 | 
			
		||||
    tmux \
 | 
			
		||||
      new-session -d -s prezto \; \
 | 
			
		||||
      set-option -t prezto destroy-unattached off &> /dev/null
 | 
			
		||||
  else
 | 
			
		||||
    tmux_session
 | 
			
		||||
  fi
 | 
			
		||||
 | 
			
		||||
  exec tmux new-session -t "$tmux_session"
 | 
			
		||||
  if zstyle -t ':prezto:module:tmux:auto-start' mode shared; then
 | 
			
		||||
      # Attach to the 'prezto' session or to the last session used.
 | 
			
		||||
      exec tmux attach
 | 
			
		||||
  else
 | 
			
		||||
      # Find a session to share windows with.
 | 
			
		||||
      tmux_session=`tmux list-sessions -F '#S' | head -n 1`
 | 
			
		||||
      exec tmux new-session -t "$tmux_session"\; set-option destroy-unattached on
 | 
			
		||||
  fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -152,4 +152,3 @@ 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