Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lalitaalaalitah/a7e59638fab9cf75862fd781dd9b9b93 to your computer and use it in GitHub Desktop.
Save lalitaalaalitah/a7e59638fab9cf75862fd781dd9b9b93 to your computer and use it in GitHub Desktop.

Revisions

  1. lalitaalaalitah created this gist May 26, 2024.
    28 changes: 28 additions & 0 deletions [macos] "Open folder with wezterm" from finder context menu
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    TakenFrom : [macos] "Open folder with wezterm" from finder context menu #4627 : https://github.com/wez/wezterm/discussions/4627





    ghry5
    Nov 30, 2023

    Was missing the simple functionality to have an option in the context menu to open a folder directly in wezterm from finder. Its actually super easy to set up:

    Open Automator: Search for Automator in Spotlight and open it
    Create new Quick Action
    Set Worflow receives current option to "folders" in "Finder.app", set any custom Image.
    On the left side search for "Run shell script"
    Change Pass input to "as arguments"
    add the following script:

    for f in "$@"
    do
    /opt/homebrew/bin/wezterm start --cwd "$f"
    done

    Hit File > Save and give it a name: "Open in Wezterm"

    Now, when you right-click a folder in Finder, you should see the "Open in Wezterm" option in the context menu under Quick Actions > Open in Wezterm. Clicking it will open the selected folder in Wezterm.

    I also added a "open file/folder in neovim (in wezterm)" by adjusting the quick action like requested here: #3990