Created
August 24, 2023 08:16
-
-
Save Inndy/f01ec9e6392733137ff75f7bcfa265ac to your computer and use it in GitHub Desktop.
Execute command in new tab (for iTerm)
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
tab() { | |
s=$(printf "%s" "$*" | base64 | tr -d \\n) | |
osascript &>/dev/null <<EOF | |
tell application "iTerm" | |
activate | |
tell current window to set tb to create tab with default profile | |
tell current session of current window to write text " eval \$(echo $s | base64 --decode)" | |
end tell | |
EOF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment