mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Add support for OS X Lion's restore windows after quit
By default, Lion's Terminal.app will re-open all windows after quitting and restarting the app, but only in bash using a chpwd hook found in /etc/bashrc. See also http://superuser.com/questions/313650/resume-zsh-terminal-os-x-lion
This commit is contained in:
parent
a738ca9b64
commit
6f2bb55398
1 changed files with 20 additions and 2 deletions
|
|
@ -1,8 +1,12 @@
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# FILE: osx.plugin.zsh
|
# FILE: osx.plugin.zsh
|
||||||
# DESCRIPTION: oh-my-zsh plugin file.
|
# DESCRIPTION: oh-my-zsh plugin file.
|
||||||
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
|
# AUTHORS: sorin-ionescu
|
||||||
# VERSION: 1.0.1
|
# benlangfeld
|
||||||
|
# robbyrussell
|
||||||
|
# betawaffle
|
||||||
|
# rgm
|
||||||
|
# VERSION: 1.0.2
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -97,3 +101,17 @@ function trash() {
|
||||||
IFS=$temp_ifs
|
IFS=$temp_ifs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ $TERM_PROGRAM == "Apple Terminal" ]] && [[ -z "$INSIDE_EMACS" ]] {
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
|
||||||
|
function lion_resume_chpwd {
|
||||||
|
# add support for OS X Lion window resume on Terminal.app relaunch
|
||||||
|
# straight port from /etc/bashrc on Lion
|
||||||
|
local SEARCH=' '
|
||||||
|
local REPLACE='%20'
|
||||||
|
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
|
||||||
|
printf '\e]7;%s\a' "$PWD_URL"
|
||||||
|
}
|
||||||
|
|
||||||
|
add-zsh-hook chpwd lion_resume_chpwd
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue