Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal.app versus global shortcut #129

Open
gcbw opened this issue Apr 6, 2016 · 19 comments
Open

Terminal.app versus global shortcut #129

gcbw opened this issue Apr 6, 2016 · 19 comments
Assignees
Milestone

Comments

@gcbw
Copy link

gcbw commented Apr 6, 2016

When i press the Option+tab shortcut and the focus is currently on a Terminal.app window, the terminal app just behave as if i had pressed Tab without any modifier.

I already entered the Terminal settings and deleted all the keyboard modifiers that include either Option or Tab.

@numist numist added the bug label Apr 8, 2016
@numist numist added this to the β.next milestone Apr 8, 2016
@numist numist self-assigned this Apr 8, 2016
@numist numist removed the bug label Apr 8, 2016
@numist
Copy link
Owner

numist commented Apr 8, 2016

@gcbw: This seems like it might be a problem with the first-run flow. There is supposed to be a dialog that prompts you to turn on accessibility so Switch's hotkeys and window switching will work, but it often gets hidden under other windows.

If you go to System Preferences → Security and Privacy → Accessibility, does Switch have access to control the computer (is the box checked)?

@gcbw
Copy link
Author

gcbw commented Apr 8, 2016

@numist i did that. The flow worked out just fine. In fact, better than other switchers.

it works everywhere, except Terminal.app

i am using iTerm2 now to work around

@gcbw
Copy link
Author

gcbw commented Apr 8, 2016

I just noticed several other things here... only show apps from one screen and most settings are disabled (updates, everything in the hotkeys tab). is this expected or do i have a botched build and am just wasting everyones time?

@numist
Copy link
Owner

numist commented Apr 8, 2016

How strange, I wasn't able to reproduce on my MBA11 running 10.11.3. Does the Switch log (-click on the Switch status bar item to get to the log folder) say anything different when you try to use the hotkey when focused on Terminal vs when it's working normally?

If there's no obvious smoking gun in the log, could you could send your system information (from System Information.app), a copy of com.apple.Terminal.plist (from ~/Library/Preferences), and the Switch log to [email protected]?

In terms of the preferences, it's been a long time since a release (I'm working full time writing software again, which cuts into software as a hobby), but the version on the develop branch only has disabled:

  • General → Updates (since there has never been a non-beta version)
  • Hotkeys (customizing hotkeys is a planned feature, but having the pane there makes initial discovery easier).

My memory is a bit unreliable, but I think the last released version (0.0.8β) had the same level of active features, most of the changes since then have been performance and stability related.

@gcbw
Copy link
Author

gcbw commented Apr 8, 2016

ok so the prefs disabled are fine. i'm struggling with rake/rvm here to try to get a decent build from source.

here is the log. after i raise Terminal, nothing shows up on the logs. And nothing happens anyway...

logs show my session with 3 windows. iTerm2, Terminal, Finder.

2016-04-08 13:56:03.145 Switch[1310:10079] SWAppDelegate.m:35 Launched Switch 0.0.8 (β)
2016-04-08 13:56:07.853 Switch[1310:10079] SWCoreWindowService.m:162 Switch is active (0.000s elapsed)
2016-04-08 13:56:07.857 Switch[1310:10079] SWCoreWindowService.m:377 Window list loaded with 3 windows (0.004s elapsed)
2016-04-08 13:56:07.857 Switch[1310:10079] SWCoreWindowService.m:383 Index does not need adjustment (0.004s elapsed)
2016-04-08 13:56:08.005 Switch[1310:10079] SWCoreWindowService.m:472 Display timer fired 0.001s late (0.151s elapsed)
2016-04-08 13:56:09.716 Switch[1310:10079] SWCoreWindowService.m:589 Dismissed (1.863s elapsed)
2016-04-08 13:56:09.747 Switch[1310:10083] SWAccessibilityService.m:182 Raising iTerm2 window 0x7facd1749800 <72 (1. sh)> took 0.001s
2016-04-08 13:56:10.757 Switch[1310:10079] SWCoreWindowService.m:162 Switch is active (0.000s elapsed)
2016-04-08 13:56:10.762 Switch[1310:10079] SWCoreWindowService.m:377 Window list loaded with 3 windows (0.005s elapsed)
2016-04-08 13:56:10.762 Switch[1310:10079] SWCoreWindowService.m:383 Index does not need adjustment (0.005s elapsed)
2016-04-08 13:56:10.907 Switch[1310:10079] SWCoreWindowService.m:472 Display timer fired 0.000s late (0.150s elapsed)
2016-04-08 13:56:12.188 Switch[1310:10079] SWCoreWindowService.m:589 Dismissed (1.432s elapsed)
2016-04-08 13:56:12.207 Switch[1310:10121] SWAccessibilityService.m:182 Raising Finder window 0x7facd17408b0 <84 (/Users/gbarros/Library/Logs/Switch)> took 0.001s
2016-04-08 13:56:12.741 Switch[1310:10079] SWCoreWindowService.m:162 Switch is active (0.000s elapsed)
2016-04-08 13:56:12.744 Switch[1310:10079] SWCoreWindowService.m:377 Window list loaded with 3 windows (0.003s elapsed)
2016-04-08 13:56:12.745 Switch[1310:10079] SWCoreWindowService.m:383 Index does not need adjustment (0.004s elapsed)
2016-04-08 13:56:12.892 Switch[1310:10079] SWCoreWindowService.m:472 Display timer fired 0.000s late (0.150s elapsed)
2016-04-08 13:56:13.548 Switch[1310:10079] SWCoreWindowService.m:589 Dismissed (0.807s elapsed)
2016-04-08 13:56:13.566 Switch[1310:10098] SWAccessibilityService.m:182 Raising Terminal window 0x7facd16e1ea0 <82 (Terminal)> took 0.001s
2016-04-08 13:56:31.012 Switch[1310:10079] SWCoreWindowService.m:162 Switch is active (0.000s elapsed)
2016-04-08 13:56:31.016 Switch[1310:10079] SWCoreWindowService.m:377 Window list loaded with 4 windows (0.004s elapsed)
2016-04-08 13:56:31.016 Switch[1310:10079] SWCoreWindowService.m:383 Index does not need adjustment (0.004s elapsed)

@gcbw
Copy link
Author

gcbw commented Apr 8, 2016

managed to (barely) build it, but have zero familiarity with xcode... i can only bind the intermediate frameworks in my build dir...

xcode builds without any issue. just show a toaster "build successful" but i can't find a binary anywhere. And rake app fails with:

❌ error: There is no SDK with the name or path '/Users/gbarros/code/Switch/Frameworks/Sparkle/macosx10.9'

@numist
Copy link
Owner

numist commented Apr 8, 2016

Bad news, my fork of Sparkle broke when OS X was released. Good news, the project is actively maintained again so I don't have to maintain it anymore!

Pushed 058c799 to develop, you'll need to run rake dep first and then rake app should work.

@gcbw
Copy link
Author

gcbw commented Apr 12, 2016

silly question, what is the correct setup to run rake deps and install the gems in the repo path, not globally (which requires sudo in standard ruby mac osx install). Do you just install everything for all projects globally?

@gcbw
Copy link
Author

gcbw commented Apr 12, 2016

needed this to build on that revision

+++ b/Switch.xcodeproj/project.pbxproj
@@ -1334,6 +1334,7 @@
                CLANG_CXX_LIBRARY = "libc++";
                CLANG_ENABLE_MODULES = NO;
                CLANG_ENABLE_OBJC_ARC = YES;
+               CLANG_ENABLE_OBJC_WEAK = YES;
                CLANG_WARN_CONSTANT_CONVERSION = YES;
                CLANG_WARN_EMPTY_BODY = YES;
                CLANG_WARN_ENUM_CONVERSION = YES;
@@ -1373,6 +1374,7 @@
                CLANG_CXX_LIBRARY = "libc++";
                CLANG_ENABLE_MODULES = NO;
                CLANG_ENABLE_OBJC_ARC = YES;
+               CLANG_ENABLE_OBJC_WEAK = YES;
                CLANG_WARN_CONSTANT_CONVERSION = YES;
                CLANG_WARN_EMPTY_BODY = YES;
                CLANG_WARN_ENUM_CONVERSION = YES;

@numist
Copy link
Owner

numist commented Apr 12, 2016

I don't have many projects that use Ruby; the dependencies are installed globally (for that version of ruby, via rvm) on my machine.

Interesting that CLANG_ENABLE_OBJC_WEAK needs to be set specifically; I would have expected it to be enabled by default on the latest version of Xcode?

@numist
Copy link
Owner

numist commented May 11, 2016

A lot of Switch's dependencies broke compatibility while I was looking away. Top of tree develop should work reliably now. If you're using rvm then it will select the right userspace ruby and install gems local to that version :)

@numist numist modified the milestones: 0.0.9 (β), β.next May 12, 2016
@numist
Copy link
Owner

numist commented Jun 5, 2016

Any improvement in 0.0.10?

@gcbw
Copy link
Author

gcbw commented Jun 9, 2016

taking me forever to compile... not familiar with either rake/git external references (rake deps always fails if the base repo is not a clean clone of this) nor xcode's random files diffs...

anyway, tested a clean build of .10b from a clean checkout, and i still get the same results.

@numist
Copy link
Owner

numist commented Jun 15, 2016

Maybe I can reproduce this with more information about your configuration; can you share a sysdiagnose?

@gcbw
Copy link
Author

gcbw commented Jun 15, 2016

i tried disabling every keyboard shortcut option on Terminal.app, and i also disabled karabiner. Nothing changed. Also, i noticed that the hijack of option+tab does not happen only on the terminal itself, but on it's setting windows!

also, here is what i "type" on terminal.app when i press option+tab with or without Switch running:

 $ hexdump x
0000000 1b 09                                          
0000002

TAB ESC. weird.

@vanrijn
Copy link

vanrijn commented Sep 10, 2016

Weird. I can't reproduce this. I'm running 10.11.6 (15G1004) and ToT from the develop branch. Option+Tab works fine with Terminal for me. =:/

@ghost
Copy link

ghost commented May 23, 2017

Could it be related to Use Option as meta key?

@gcbw
Copy link
Author

gcbw commented May 23, 2017

@MEGADR01D good find, but i don't think it plays anything here. I always had that off (vim ftw!). I just tested now and it doesn't change anything. Terminal.app hijacks the key combo with that setting on or off.

I ditched terminal.app because of this. I use iTerm2 exclusively now when i am forced to use a mac.

@numist
Copy link
Owner

numist commented May 26, 2017

i tried disabling every keyboard shortcut option on Terminal.app, and i also disabled karabiner. Nothing changed. Also, i noticed that the hijack of option+tab does not happen only on the terminal itself, but on it's setting windows!

also, here is what i "type" on terminal.app when i press option+tab with or without Switch running:

 $ hexdump x
0000000 1b 09                                          
0000002

TAB ESC. weird.

Those are the keystrokes I'd expect to see delivered to Terminal if Switch weren't running. I wonder if Terminal's "Use Option as Meta key" setting is implemented in such a way that obscures Switch's use of OPT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants