Created
February 17, 2011 03:40
-
-
Save founddrama/830921 to your computer and use it in GitHub Desktop.
Some sample code for setting the Terminal title which didn't work; and one that did.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# did not actually work | |
alias mycd="cd /path/to/directory/of/interest; | |
osascript ~/Library/Scripts/set-terminal-tab-title.scpt | |
`pwd | cut -d'/' -f5`;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- did not actually work... | |
on run argv | |
tell application "Terminal" | |
set terms to every window in application "Terminal" | |
repeat with term in terms | |
if term is frontmost then | |
set tTabs to every tab in term | |
repeat with tTab in tTabs | |
if tTab is selected then | |
set cTitle to item 1 of argv | |
set custom title of tTab to cTitle | |
end if | |
end repeat | |
end if | |
end repeat | |
end tell | |
end run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1='\[\033]0;`(basename $(pwd))`\007\]\n[\t \w]\n\u@\h $ ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment