Git Product home page Git Product logo

alfred-tty's Introduction

^tty workflow for Alfred

A JXA-based workflow for Alfred Powerpack users to quickly switch between or close iTerm windows, tabs and panes based on title and tty, or trigger your preferred ssh workflow when no open session is found (supports both isometry/alfred-ssh and deanishe/alfred-ssh).

Releases

Requirements

Usage

Trigger the workflow with the keyword tty, or via hotkey, followed by some characters from the title of an open window, tab or pane; press Enter to activate the selected window/tab/pane, Alt-Enter to close it, or Cmd-Enter to trigger your ssh workflow. For example, enter tty as3 to switch to a tab with the title user@azure-server-03.

If no active terminal matches, or you use the Cmd-modifier, trigger your preferred ssh workflow, e.g. ⇄ ssh as3. By default, the ssh workflow is assumed to be net.isometry.alfred.ssh (i.e. isometry/alfred-ssh, version 2.3+). Override by setting the ssh_workflow and ssh_trigger variables; for deanishe/alfred-ssh, set the ssh_workflow variable to net.deanishe.alfred-ssh.

In order to make working with more than one window/tab/pane with the same title easier, the tty is displayed beneath the result, and can be provided as a second argument to the trigger. For example, enter tty lo 3 to select the the session with title localhost running on /dev/ttys003.

To select by tty alone, use two spaces between the trigger and the tty number. For example, tty 4 will select /dev/ttys004.

Optionally associate a hotkey trigger to further accelerate operation, e.g. Ctrl+Cmd+T, or change the trigger word via the keyword variable.

Combine with an iTerm2 profile configured as ssh protocol handler (e.g. "Name":=$$USER$$@$$HOST$$, "Command":=$$ and "Schemes handled":=ssh) and an alfred-ssh workflow to make opening and jumping between remote sessions across many windows, tabs and panes easy.

Workflow Variables

keyword – the keyword trigger for the workflow; default: tty.

ssh_workflow – the workflow bundle identifier for your preferred alfred-ssh workflow; default: net.isometry.alfred.ssh.

ssh_trigger – the name of the trigger within ssh_workflow; default: ssh.

iterm_application – the application identifier of the iTerm2 instance you want to control, either bundleId, application name or absolute path; default: com.googlecode.iterm2.

alfred-tty's People

Contributors

isometry 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

alfred-tty's Issues

How to use the action.js script to go to a specified iTerm tab?

I want to make a hotkey that would open the second tab of iTerm when activated.

I tried to transfer the main part of the code like so :

function run(args)
{
var iterm = Application(getenv("iterm_application", "com.googlecode.iterm2"));
var win = iterm.windows[0];
var tab = win.tabs[2];
var ses = tab.sessions[0];
tab.select()
}

Also I call this JXA from Keyboard Maestro like so :

2017-10-04 at 13 22

I am quite new to JXA but I am kind of confused by this.

Thank you for any help.

freezes iTerm

Hi,

I'm using iTerm2 3.1.beta.9 but when I try to select a tab using the new tty workflow it just freezes up iTerm2 altogether. I'm not able to select any tab, and I'm not able to type in the tab that is open.

I'd be happy to help debug if I can get you some more information to help.

Brad

It does not actually jump to iTerm tab

Not really sure why that happens but pressing on the result does nothing.

I get this error when running it and selecting some result :

[2017-09-11 23:33:42][ERROR: action.script] /Users/nikivi/alfred/Alfred.alfredpreferences/workflows/user.workflow.E3DFF5F0-0F9C-4174-952D-FB2804EAA834/action-tty.js:1:36: script error: Error on line 2: SyntaxError: Unexpected token '='. Expected a ')' or a ',' after a parameter declaration. (-2700)

typo in link

Link says it's going to deanishe/alfred-ssh, it goes to deanish/alfred-ssh

Add case insensitive search

Currently if tab has case sensitive name like sVim:

2019-07-24 at 18 03

If you search for just svim, nothing will be returned:

2019-07-24 at 18 03

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.