An improved PopClip extension to run selected text in Terminal. This project is derived from willbchang/alfred-run-in-terminal
demo.mp4
- Go to release page
- Download and unzip
RunInTerminal.zip. - Double click
RunInTerminal.popclipextzto install.
-
Auto-detect whether current selected text is a filepath and run
cdif it is.~will be auto expanded to/Users/USER_NAMEfor checking the filepath.- Spaces before filepath will be removed in order to use
cd.
Input:
~/Library/Application Support/Output:
cd "/Users/USER_NAME/Library/Application Support/"
-
Auto remove the solo
$in the beginning of lines.- Some bash code snippets always prefix with
$, it's annoying when copy and running them. - It won't affect the bash argument, only the
$with space will be removed, regex:/^\s*\$\s+/
Input:
$ temp=$(mktemp) $ echo "$temp" $ rm "$temp" $(whoami)
Output:
temp=$(mktemp) echo "$temp" rm "$temp" $(whoami)
- Some bash code snippets always prefix with
-
Auto-detect whether current Terminal tab is running command, it will open a new tab if current tab has active process.
- Tested with
zsh,bashandfish. - Support figterm.
- Tested with
-
It won't mess up with escaping characters even though this extension uses
ruby,applescriptandshell scripttogether.Input:
variable="This is a \$10 \"quote\"" echo $variable
Output:
variable="This is a \$10 \"quote\"" echo $variable
Only Terminal.app is supported, the AppleScript that Terminal.app uses is not compatible with iTerm.app, pull requests are welcome for iTerm.app or other terminal emulators.
AGPL-3.0