Skip to content

Instantly share code, notes, and snippets.

@Inndy
Created August 24, 2023 08:16
Show Gist options
  • Save Inndy/f01ec9e6392733137ff75f7bcfa265ac to your computer and use it in GitHub Desktop.
Save Inndy/f01ec9e6392733137ff75f7bcfa265ac to your computer and use it in GitHub Desktop.
Execute command in new tab (for iTerm)
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