Jump to content

isometry

Member
  • Posts

    47
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by isometry

  1. 15 hours ago, Maddog said:

    1) It lists the tabs/panes, but Enter does not activate iTerm for me.

     

    Thanks for the bug report. I suspect an incompatibility with my JXA code and OSX 10.11; I'd only tested on 10.12 and 10.13 beta. I'm firing up a VM to investigate.

     

    Update: Please try my v1.2-beta1 pre-release for OSX 10.11 compatibility!

     

    Quote

    2) Also, see attached screenshot,  any idea why it doesn't fill the available space? Almost every entry is cut off (oh actually in most only the path is cut-off, but I would prefer to see it, or part of it, if there's space).

     

    I display the full session title as reported by iTerm2. In your case, I can only surmise that your sessions have tabs/sessions have been set as displayed. I suggest you refer to the iTerm2 FAQ and customise your shell to a title that better matches your needs.

     

    Quote

    3) See that npm (node) line in the screenshot? Is it possible for it to be searchable by the working directory it's running from?

     

    Unfortunately, iTerm2 doesn't expose the working directory, so this is unavailable to filter on without further effort on your part. I would suggest customising your tab titles through your shell (as above) to include the information you want to search on, or if they're long-running tweaking them manually with Cmd+I.

     

    The entire scrollback history is available, and I did play with filtering history (and the last line/screen of output, which commonly includes working directory). Unfortunately, performance goes down the drain as soon as you have a single pane with significant scrollback (I tend to run with unlimited scrollback), rendering the entire workflow unusable; I suppose I could expose this behind a default-disabled feature flag for those that don't rely on a large scrollback, but I'm not convinced it would be that useful… if anyone seriously thinks otherwise, log a feature request.

  2. A JXA-based workflow for Alfred 3 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).

     

    GitHub: https://github.com/isometry/alfred-tty

    Latest Release: https://github.com/isometry/alfred-tty/releases/latest

    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.

     

    matches.thumb.png.12a164216aa92c4c1105c603ca9e369d.png

     

    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 deanish/alfred-ssh, set the ssh_workflow variable to net.deanishe.alfred-ssh.

     

    no_match.thumb.png.57c3852fcbd56e50ac7460eadfc0b8f8.png

     

    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.

  3. Same problem here, solved by following these instructions:

     

    http://www.alfredforum.com/topic/8927-cant-seem-to-get-comics-workflow-to-work/?p=44322

     

    Perfect. Thanks, @okapi!

    I was thinking I'd like to update to using the Alfred 2.4+ environment variables, but your tracking use of static paths down to a real issue gave me the impetus to actually do so.

    The workflow has now been updated with enhanced Alfred 3 compatibility and is available on GitHub, here and on Packal.

  4. Any chance of being able to configure this workflow to open in a new tab instead of a new window? Would work better with TotalTerminal: http://totalterminal.binaryage.com/

     

    Are you aware of iTerm2's Hotkey Window? It provides arguably more powerful functionality to that of TotalTerminal, and iTerm2's default behaviour as ssh protocol handler is "Open in a New Tab". Performance improvements over the past year combined with the addition of Infinite Scrollback leave me little reason to fallback to Terminal.app or hacking SIMBL plugins :-)

  5. user.workflow.3ACC632C-5489-45C1-92AA-6FC07DC4B472 yossarian$ python -c 'import alfredssh; print alfredssh.complete("local");'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "alfredssh.py", line 137, in complete
        fetch_known_hosts('~/.ssh/known_hosts'),
      File "alfredssh.py", line 83, in fetch_known_hosts
        results.update(line.split()[0].split(','))
    IndexError: list index out of range
    

    ^^ First command - fwiw, my python version when running that command is 2.7.8. The /usr/bin version is 2.7.5 and gives me the same output.

     

    OK. It looks like your ~/.ssh/known_hosts contains a line that the workflow couldn't handle: most likely a blank line (with which I reproduced the error). I've updated it to handle blanks at GitHub and Packal: download

    Thanks for reporting the issue!

    Bonus fix: it also now ignores encrypted entries in ~/.ssh/known_hosts.

  6. Errr, I would, but I don't get any other errors or anything. I downloaded it from Packal, if that makes any difference. Anything in particular I can do to help debug?

     

    Given you're using this workflow, I'll assume you're happy at the command line :-)

    Change to the workflow's directory in Alfred preferences (found by right clicking on the Workflow and choosing "Show in Finder", if necessary), and run a query manually:

    % (Pythagoras:~/Dropbox/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.E2B2A958-21D2-42ED-B6DF-06AF15C6A201) /usr/bin/python -c 'import alfredssh; print alfredssh.complete("local");'
    <items><item arg="local" autocomplete="local" uid="ssh://local"><title>ssh://local</title><subtitle>Connect to ssh://local (source: input)</subtitle><icon>icon.png</icon></item><item arg="localhost" autocomplete="localhost" uid="ssh://localhost"><title>ssh://localhost</title><subtitle>Connect to ssh://localhost (source: /etc/hosts)</subtitle><icon>icon.png</icon></item><item arg="monster.local" autocomplete="monster.local" uid="ssh://monster.local"><title>ssh://monster.local</title><subtitle>Connect to ssh://monster.local (source: ~/.ssh/known_hosts)</subtitle><icon>icon.png</icon></item></items>

    The output shows the workflow offering to open ssh://local (from the input provided), ssh://localhost (from /etc/hosts), ssh://monster.local (from ~/.ssh/known_hosts) when triggered with the equivalent of "ssh local" in Alfred.

    If the above returns an empty list as opposed to an error or a valid list, then try running the function which parses ~/.ssh/config (which I assume is the config file you say is symlinked):

    % (Pythagoras:~/Dropbox/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.E2B2A958-21D2-42ED-B6DF-06AF15C6A201) /usr/bin/python -c 'import alfredssh; print alfredssh.fetch_ssh_config("~/.ssh/config");' 
    ([u'host.example.com', u'monster'], '~/.ssh/ssh_config')
    

    You should get an entry for every non-wildcard entry in your ~/.ssh/config file (host lines which include any of *, ? or ! are excluded).

    NB: yes, there's currently an inconsistency. For some reason I chose to display entries from ~/.ssh/config as coming from ~/.ssh/ssh_config. Fix forthcoming.

  7. This workflow isn't working for me, and I think it's because my config file is symlinked to Dropbox. When I type in `ssh` and start writing a hostname, it says "please wait" or whathaveyou for a split second before dropping me back to the standard Google prompt. Could the symlink be the issue?

     

    This is odd. Even if you just type "ssh randomhost" it should offer to "Connect to ssh://randomhost (source: input)". That your .ssh/ssh_config is a symlink, or on Dropbox should make no difference whatsoever. Can you provide any more detail?

  8. A simple workflow to explore the English language via Agile Tortoise, Inc's excellent interface to Princeton University's WordNet database.

     

    Uses the keyword "term" followed by the word or term you want to define/explore.

     

    terminology_example1.png

     

    Download / Source

     

    If you like it, Agile Tortoise's Terminology app does the same thing for iPhone/iPad (NB: I have no affiliation to them).

     

    - isometry

  9. "can easily be switched to iTerm2.app" - How?

     

    Something along the following lines should do the job:

     

    1. Create a new profile named "Man Page Handler" (or whatever)
    2. Set its command to "/usr/bin/man $$HOST$$" (without the quotes)
    3. Select "x-man-page" under "Schemes Handled"
  10. @ctwise: excellent tips regards Selection in OS X and Automatically paste to front most app - thank you! I'll think about how best to integrate them into the release in such a way that (ideally) both behaviours are available. What you suggest is actually what I originally had in mind, though it doesn't necessarily fit well with, for example, selecting text from a terminal window.

     

    Regards the format of feedback, I did try it that way around, but because you can (and should!) define your own aliases, which (currently) lack descriptions, it didn't make sense to do so. I could change the syntax, of course: | define description==pipeline@@. What do you think?

  11. Others have mentioned it already, but my ssh workflow is what I've wanted from Alfred since I first lumped for a Mega Supporter license in his infancy over two years ago. As soon as I found the new Script Filter object, I knew what I had to do. Having not yet found this forum, I started by reverse engineering David's PHP-based built-in Google Suggest workflow to figure out what my Python script had to output to get a result. D'oh  :ph34r:

     

    My pipe workflow isn't getting much love, probably because I haven't sold it very well, but I'm also using that *alot* to filter and transform text.

     

    Others I currently find myself using regularly:

     - Colors by Tyler Eich

     - Create OmniFocus Tasks by Aaron B. Hockley (great for adding a todo for an item in Gmail)

     - Movies by Simon Støvring (inspiringly awesome)

  12. Not sure people are feeling the love for this one :huh: so I've added some built-in one-liners to try and illustrate its power. I've used it at least 5 times today already.

     

    Examples include:

    • filtering the contents of the clipboard with grep
    • modifying the contents of the clipboard with sed, awk or perl
    • base64 encoding/decoding the clipboard
    • encrypting/decrypting the clipboard with AES-256
    • sorting the clipboard
    • reversing the lines in the clipboard
    • strip blank lines from the clipboard
    • upper/lowercasing the clipboard
    • add line numbers to the clipboard

    full listing of the built-ins

×
×
  • Create New...