Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
87d94023
Commit
87d94023
authored
Feb 10, 2015
by
Jorge Bucaran
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #368 from bobthecow/fix-tab-plugin
Two fixes for tab plugin
parents
dcb43ef0
edeecff2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
plugins/tab/tab.fish
plugins/tab/tab.fish
+18
-7
No files found.
plugins/tab/tab.fish
View file @
87d94023
...
...
@@ -7,17 +7,24 @@
# tab [PATH] Open PATH in a new tab
# tab [CMD] Open a new tab and execute CMD
# tab [PATH] [CMD] ... You can prolly guess
#
# If you use iTerm and your default session profile isn't "Default Session",
# override it in your config.fish
#
# set -g tab_iterm_profile "MyProfile"
function tab -d 'Open the current directory (or any other directory) in a new tab'
set -l cmd ''
set -l cdto $PWD
if test (count $argv) -gt 0 -a -d $argv[1]
pushd . >/dev/null
cd $argv[1]
set cdto $PWD
set -e argv[1]
popd >/dev/null
if test (count $argv) -gt 0
if test -d $argv[1]
pushd . >/dev/null
cd $argv[1]
set cdto $PWD
set -e argv[1]
popd >/dev/null
end
end
if test (count $argv) -gt 0
...
...
@@ -27,10 +34,14 @@ function tab -d 'Open the current directory (or any other directory) in a new ta
switch $TERM_PROGRAM
case 'iTerm.app'
set -l profile 'Default Session'
if set -q tab_iterm_profile
set profile $tab_iterm_profile
end
osascript 2>/dev/null -e "
tell application \"iTerm\"
tell current terminal
launch session \"
Default Session
\"
launch session \"
$profile
\"
tell the last session
write text \"cd \\\"$cdto\\\"$cmd\"
end tell
...
...
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