Skip to content

Commit

Permalink
fixed not runnign command on click
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverisaac committed Jan 19, 2022
1 parent 0679190 commit 224e9c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Then `cmd-click` on the output filename.

# Configuration

You will need to set these configuration items in the `command to run` textbox of iTerm2's preferences.


### `ITERM_CMD_DIR`

Expand Down Expand Up @@ -101,3 +103,7 @@ kubectl get pods -o name | while read podname; do
echo "$output"
done
```

### `ITERM_CMD_RUN_ON_CLICK`

This will cause iterm-cmd to send a newline character after reading the command file. It does not guarantee that a command will not run. But helps it along if the command does not contain the trailing newline
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func handleClick(workDir string) error {
defer src.Close()

io.Copy(os.Stdout, src)
if lookupBoolEnv("ITERM_CMD_RUN_ON_CLICK", true) {
fmt.Printf("\n")
}
return nil
} else if isDir {
logrus.Trace("fileArg is a directory, going to CD to it")
Expand Down

0 comments on commit 224e9c5

Please sign in to comment.