Skip to content

Instantly share code, notes, and snippets.

@vbratkev
Forked from LeoUfimtsev/iterm_cmd.sh
Created July 31, 2021 17:18
Show Gist options
  • Save vbratkev/82adc12df3c594aa8fcd950dbbc2c86d to your computer and use it in GitHub Desktop.
Save vbratkev/82adc12df3c594aa8fcd950dbbc2c86d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Write given argument into current iterm session. (useful if running commands from another application).
osascript - "$@" <<EOF
on run argv
tell application "iTerm2"
tell current session of current window
repeat with arg in argv
write text arg
end repeat
end tell
end tell
end run
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment