Giter Site home page Giter Site logo

iterm2-finder-tools's Introduction

iTerm2 Finder Tools

New home for the code from my blogpost about opening iTerm2 directly from the Finder. Read the release post here.

What is it?

A Finder service and toolbar application that will open iTerm2 and cd to the current directory visible in the Finder.

Features

  • Works regardless if iTerm2 is running or not โ€“ will start it if necessary.
  • Creates a new tab in the current open window for this directory.
  • Creates a new window if none are already open.
  • Yeah, this is pretty simple, isn't it?

Version support

This repository includes a pre-built Finder service and a pre-built application; these work with "modern" iTerm2 (version 2.9+). If you're using an older version of iTerm2, you'll have to run the build scripts to get a version that works for you. See the instructions below.

Installation

First, either download the repository with the big green button in the upper right or clone the repository like this:

$ git clone https://github.com/peterldowns/iterm2-finder-tools.git
Finder Service

Double click Open iTerm.workflow and click "Install"

service installation dialog

You can add a keyboard shortcut for this service by going to System Preferences > Keyboard > Shortcuts > Services > Files and Folders.

keyboard shortcut

Unfortunately, it seems that this keyboard shortcut will only work if iTerm2 is already running.

Finder Menu Tool

You can move the built Open iTerm.app anywhere you'd like (such as /Applications), or leave it here.

After attempting to run the pre-built application for the first time, you may need to go into your System Preferences > Security & Privacy and enable running the app since it was built by an "unidentified developer".

You can then add it to your Finder toolbar by dragging it in while holding the command and option keys (pre-Sierra) or while holding the command key (Sierra or later).

toolbar app install

Build

Build the application and Finder service like this:

$ python build.py

The build script will detect which version of iTerm2 you have installed and automatically use the right applescript -- *.modern.applescript for version 2.9+, and *.applescript for older versions.

The build script should work with both Python 2 and Python 3.

Hacking / Contributing

Edit the .applescript files in the service and workflow directories, then build as described above. You can read the build script for the exact details, but essentially these files are being substituted in to some Automator-based scaffolding to get out the application and service. The .modern.applescript files should work with iTerm2 2.9+'s API, and the .applescript files should work with their older API.

iterm2-finder-tools's People

Contributors

curby avatar peterldowns avatar tmepple avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iterm2-finder-tools's Issues

An alternative

I find

on run {input, parameters}
	tell application "Finder"
		set dir_path to quoted form of (POSIX path of (folder of the front window as alias))
	end tell
	do shell script ({"open ", dir_path, " -a iterm"} as string)
end run

Works well. And it opens the directory in a new tab.

I only tested this snippet as application, but service should work, too.

I'm not very familiar with applescript, if there is any problem please point out ๐Ÿ˜„

open in new window

Hi, great stuff. Do you know how to make it open in new window instead new tab?

Shortcut not working under Sierra 10.12.5

For me the Shortcut is not working under Sierra. I have tried multiple Key combinations, but none is working. It just happenings nothing, like I haven't pressed anything.

Have your experienced the same issue?

Thanks

Focus iTerm

Is it possible to automatically move focus to the iTerm window after opening a folder, rather than focus staying on the Finder window?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.