Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
4e306887
Commit
4e306887
authored
Dec 01, 2015
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup update_terminalapp_cwd function
parent
eca912e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
termsupport.zsh
lib/termsupport.zsh
+4
-5
No files found.
lib/termsupport.zsh
View file @
4e306887
...
...
@@ -76,19 +76,18 @@ preexec_functions+=(omz_termsupport_preexec)
# With extra fixes to handle multibyte chars and non-UTF-8 locales
if
[[
"
$TERM_PROGRAM
"
==
"Apple_Terminal"
]]
&&
[[
-z
"
$INSIDE_EMACS
"
]]
;
then
# Emits the control sequence to notify Terminal.app of the cwd
# Identifies the directory using a file: URI scheme, including
# the host name to disambiguate local vs. remote paths.
function
update_terminalapp_cwd
()
{
emulate
-L
zsh
# Identify the directory using a "file:" scheme URL, including
# the host name to disambiguate local vs. remote paths.
# Percent-encode the pathname.
local
URL_PATH
=
"
$(
omz_urlencode
-P
$PWD
)
"
[[
$?
!=
0
]]
&&
return
1
local
PWD_URL
=
"file://
$HOST$URL_PATH
"
# Undocumented Terminal.app-specific control sequence
printf
'\e]7;%s\a'
$PWD_URL
printf
'\e]7;%s\a'
"file://
$HOST$URL_PATH
"
}
# Use a precmd hook instead of a chpwd hook to avoid contaminating output
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment