Jump to content

Terminal Control Workflow


Recommended Posts

This is how I fixed it.

Probably NOT the best practice so do this at your own risk.

 

With MacOS High Sierra the version of Ruby is: 

~  >ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]

Go into you Alfred Preferences and pick the "Workflows"  icon at the top.

Right Click on the Terminal Control and pick "Open in Finder"

59de31880c9ec_mono-snap-AlfredPreferences2017-10-1110-41-21.thumb.jpg.a4dd21254c3ea0269cf601a5afc7108c.jpg

 

When the finder opens, copy the 2.1.0 directory to a 2.3.0 directory.

It should now work.

If not try restarting Alfred.

 

 

 

 

Edited by robdbirch
Link to comment
6 hours ago, robdbirch said:

It’s appears it is looking for the Alfredo ruby gem Link. I am not very familiar with Alfred workflows. I don’t know when this gem gets installed, as part of the Terminal workflow or was it part of the standard Alfred install at one time?

 

Hi @robdbirch and @GFEMajor , apologies for this error.  I typically update the plugin on day 1 of a new OS release, but I haven't upgraded either of my machines to highSierra yet, and thus let you all down!  I will try to upgrade and get a clean solution released by next week.

Link to comment
On 10/11/2017 at 4:25 PM, GFEMajor said:

Thanks @wkoffel for the fast reply. I will wait for the updated workflow. @robdbirch thanks for the afford and nice to know there is a solution ?.

New update is ready @GFEMajor, @robdbirch.  See original post which has been updated or announcement below.  And let me know if it's working for you now, just to make sure I got it all bundled up sufficiently (this was a tricky one, as some of the dependency versions gave me headaches on 10.13)

 

Link to comment
7 hours ago, GFEMajor said:

Hi @wkoffel, the workflow is working again, but it only opens the profile (iterm), if iterm is already running. if it is not running, nothing happens.

 

I'm not sure if this is a bug in the workflow or a config issue, because i was moving to a new macbook.

Yes, that's a known issue, and was true in prior versions as well.  The Applescripting support in iTerm works differently from Terminal, and would require a change in the approach to fix it, hasn't been worth it, since it's mostly relevant on first launch, or for people who quit their apps a lot. 

Link to comment
17 hours ago, GFEMajor said:

But on my old mac it is working?? Is there a quickfix, so I can change the workflow by myself to fix this just for me? This is really an issue for me, because iterm is not running all the time...

 

Strange.  I'm on my 10.12 mac here with the prior version of the workflow, and it's not working for me, and as far as I'm aware, it's always been a known issue.

I'm testing here with macOS 10.12, and iTerm2 build 3.1.2.

 

Maybe you have a newer version of iTerm on your new machine, and the old one had the prior Applescript behavior?  Check the versions on your old mac, are they the same as the new mac?

Link to comment
  • 4 weeks later...
  • 1 month later...
set desiredSettings to "{query}"
tell application "iTerm2"
	activate
	create window with profile desiredSettings
end tell

This is a snipped from your code. iterm is refered as "iterm2", but on my mac, the app itself is called "iterm". I changed the name in your workflow from "iterm2" to "iterm" and now it opens the window on "itp XXX" even if iterm is not running ?. Maybe this could help someone.

Edited by GFEMajor
Link to comment
  • 8 months later...

Since the update to 10.14 Mojave the workflow has stopped running.

I looked in debug mode and found this exception:

 

[2018-09-26 07:41:01][ERROR: input.scriptfilter] Code 6:[..]/Alfred.alfredpreferences/workflows/user.workflow.227DDBA5-54E6-44DA-AD42-323F4A0DA6B3/bundle/ruby/2.3.0/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault at 0x000000000000d566

ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

 

Can somebody help/explain?

Link to comment
17 hours ago, GFEMajor said:

Since the update to 10.14 Mojave the workflow has stopped running.

I looked in debug mode and found this exception:

 

[2018-09-26 07:41:01][ERROR: input.scriptfilter] Code 6:[..]/Alfred.alfredpreferences/workflows/user.workflow.227DDBA5-54E6-44DA-AD42-323F4A0DA6B3/bundle/ruby/2.3.0/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault at 0x000000000000d566

ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]

 

Can somebody help/explain?

 

Hi @GFEMajor.  Typically, this extension breaks for new versions of macOS, for the reasons @deanishe mentioned.  My apologies, I hadn't upgraded any of my machines yet, as I'm not doing mac dev work right now.  I should be able to get to it this weekend at the latest.  I will post here and update the main top post when it's working for Mojave.  Thanks for your patience and interest in the workflow.

Link to comment

This workflow has been updated to v2.5 with support for Mojave.  The links in the top post are updated, or download directly here.  You can also update using alleyoop update process.

 

Let me know if you have any issues.  This appears to work find on 10.13 and 10.14, but older versions of macOS should stick with v2.4 or earlier of this workflow.  I removed some older dependencies this round to reduce the download size.

 

Thanks for getting on me to update this quickly, @GFEMajor  ? . 

Link to comment

Thank you @wkoffel for the quick update, but after updating I get the following error:

 

[2018-10-01 07:52:21][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ./bundle/bundler/setup (LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from iterm2-control.rb:2:in `<main>'

have I done anything wrong?

Edited by GFEMajor
Link to comment
11 hours ago, GFEMajor said:

Thank you @wkoffel for the quick update, but after updating I get the following error:

 


[2018-10-01 07:52:21][ERROR: input.scriptfilter] Code 1: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ./bundle/bundler/setup (LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from iterm2-control.rb:2:in `<main>'

have I done anything wrong?

 

Hrmm...so sorry for that.  I'm traveling this week, not with the machine I upgraded to 10.14, so hard to debug.  But I'm pretty sure it was looking good for me on that box.

 

Can you try manually deleting the workflow from Alfred workflow preferences, re-downloading from this location:

https://cl.ly/f5d7fa56f2b8

 

And tell me if that is working?

 

If it's still not, you can right click on the workflow, "Open in Finder" and be sure there really is a directory path, 'bundle/bundler/setup.rb', which should be there, but yours seems to be complaining is missing.

Link to comment
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...