Last active
June 12, 2023 08:03
-
-
Save ansidev/23466f69f0ef7e26205cf829a8272fce to your computer and use it in GitHub Desktop.
Open with WezTerm
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
function run(input, parameters) { | |
let dir = input.toString(); | |
const app = Application.currentApplication(); | |
app.includeStandardAdditions = true; | |
const appName = "WezTerm"; | |
const wezTermApp = Application(appName); | |
if (wezTermApp.running()) { | |
app.doShellScript(`/usr/local/bin/wezterm cli spawn --cwd "${dir}"`); | |
app.doShellScript(`osascript -e 'activate application "${appName}"'`); | |
} else { | |
app.doShellScript(`/usr/local/bin/wezterm start --cwd "${dir}"`); | |
} | |
return input; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment