Advertisement
frankjonen

Run script in new Terminal Window - maxOS High Sierra

May 1st, 2018
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.10 KB | None | 0 0
  1. # - - - - - - - - - - - - - - - - - - - - - - - - - #
  2. # > .bash_profile                                   #
  3. # - - - - - - - - - - - - - - - - - - - - - - - - - #
  4.  
  5. HISTCONTROL=ignoreboth
  6. # This excludes anything with a space before it from
  7. # your .bash_history
  8.  
  9.  
  10. alias example =" ssh myuser@example.com"
  11. alias some_other =" ssh myuser@someotherserver.com"
  12. # aliases for your ssh connections for example
  13.  
  14.  
  15. function triggerBunny() {
  16. osascript <<EOD
  17.     tell application "Terminal"
  18.         set newTab to do script "$@"
  19.     end tell   
  20. EOD
  21. }
  22.  
  23. # Call AppleScript to open a new Terminal window/tab
  24. # and run the alias piped into it via the variable.
  25. # "triggerBunny example" would run the "example" alias
  26. # in a new Terminal window/tab.
  27.  
  28.  
  29.  
  30. ✁ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  31.  
  32.  
  33.  
  34. # - - - - - - - - - - - - - - - - - - - - - - - - - #
  35. # > .inputrc                                        #
  36. # - - - - - - - - - - - - - - - - - - - - - - - - - #
  37.  
  38. # F9 to run the triggerBunny function with the alias
  39. # "example" appended as a flag
  40.  
  41. "\e[20~": " triggerBunny example \C-m"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement