Skip to content

Commit

Permalink
bumped readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverisaac committed Jan 18, 2022
1 parent 711536d commit 316242b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,48 @@ This repo has a tool which does two things:

1. Handle clicks from iterm
2. Generate files which the iterm click-handler can understand

# Installation

### 1. Clone the Repo
Clone this repo into an appropriate directory:

```
mkdir -p "$GOPATH"/src/github.com/oliverisaac/iterm-cmd
git clone git@github.com:oliverisaac/iterm-cmd.git "$GOPATH"/src/github.com/oliverisaac/iterm-cmd
```

### 2. Build and install `iterm-cmd`

```
cd "$GOPATH"/src/github.com/oliverisaac/iterm-cmd
go install .
```

### 3. Edit your iTerm2 Settings to use the handle-click script:

1. Get the path to the `handle-click` script:
```bash
readlink "$GOPATH"/src/github.com/oliverisaac/iterm-cmd/handle-click
```

2. In iTerm2, go to the application preferences (`cmd` + `comma`)

3. Select Profiles -> Default -> Advanced

4. Under "Semantic History" select "Run Coprocess..."

5. In the text box that appears, paste in the path to the `handle-click` script and add: `'\1' '\2'` at the end. It should look something like:
```
/Users/example/go/src/github.com/oliverisaac/iterm-cmd/handle-click '\1' '\2'
```

### 4. Use the script

You can now use `iterm-cmd` to generate a file which contains a command that iTerm2 can then execute. For example, run:

```
iterm-cmd echo "Hello world"
```

Then `cmd-click` on the output filename.

0 comments on commit 316242b

Please sign in to comment.