Skip to content

SendText not working with Sublime Text 4/iTerm2 #19

Open

Description

@james-torpy

Hi there,

I have Sublime Text 4 (build 4113) and iTerm2 (build 3.4.8), however I cannot get SendText to work with these programs.

I have adjusted the Default Settings as follows:
{
// Uncomment the program you want send text to:
// "program": "Terminal.app",
"program": "iTerm2",
// "program": "tmux",
// "program": "screen",
"paths":
{
"iTerm2": "/Applications/iTerm.app"
// It might be necessary to explicitly set path (usually /usr/bin
// or /usr/local/bin) to tmux and screen. Uncomment below and specify
// the correct path:
// "tmux": "/usr/local/bin/tmux",
// "screen": "/usr/local/bin/screen"
}
}

I have also tried not specifying a path to iTerm2, and also changing the program to "iTerm", but every time I try to send a command with 'Cmd Enter' either nothing happens, or it sends a command to Terminal instead.

Is this due to the recent Sublime upgrade, and if so will there be ongoing updates/support to SendText for this and future versions?

Any help would be much appreciated,
James

Activity

  1. wch commented on Aug 23, 2021

    @wch
    Owner

    I don't have time to investigate this, but the command that issues to send messages to iTerm2 is here:

    SendText/SendText.py

    Lines 41 to 44 in 9276275

    subprocess.call(['osascript', '-e', 'tell app "iTerm"',
    '-e', 'set mysession to current session of current window',
    '-e', 'tell mysession to write text "' + selection + '"',
    '-e', 'end tell'])

    It uses osascript to run some AppleScript code. If you can figure out the correct command to send messages to the terminal and want to make a PR, I'd be happy to look at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions