I am mystified as to why it would disappear. Let me know if you want to hop on a video call to debug this.
NICE. nice to know that we have the option to do a video call. for the time being lemme spend more time on this. it's not on the top of my todo list yet, and i'm traveling around. so rather than wasting your time lemme go through it at my own pace first, try to understand what i don't get, and then definitely we can hop on a call once i'm very clear about the state of things. thank you!
P.S.: moving Sparkle.framework from ThirdParty/Sparkle/Sparkle.framework to ThirdParty/Sparkle.framework works for compiling. there's other issues related to other frameworks (Markdown?) but the Sparkle issue is gone. BUT for whatever reason after the compilation the ThirdParty/Sparkle.framework stops existing again hahahahahhaahah. most probably some of your compiling tasks/build phases etc. doing something but that'll be for later. no time to check now.
yes my Xcode looks the same as yours, but there's no ThirdParty/Sparkle.framework on my clone. what there is is ThirdParty/Sparkle/Sparkle.framework. see the extra Sparkle folder. but ok again lemme fiddle with what you mentioned above and see if i can make it work.
I just cloned it fresh and it was OK. Make sure you're at the right commit:
git ls-tree. i mean i'm following the HowToBuild and tried a bunch of time from scratch. would seem that there's something in YOUR setup that people from outside are not having? or am i the only one with the issue? anyways will try and report.
I need to remap cmd-tab in some cases (when the user has remapped modifiers within the app, which is done with event taps), so that's probably why I did it so early.
oh yes that makes total sense if you need to override cmd tab.
What's the exact error you got about Sparkle? The binary framework is committed in ThirdParty/Sparkle.framework. I don't like slow builds so I just build my binary dependencies once and commit them, but it does introduce an xcode version dependency. Currently it's built for 16.1.
well ok, on my laptop i'm using Xcode 16.2 beta 3 but i can check on my Mac at home later.
but. is the Sparkle framework really committed? the error message i get:
then in the Project navigator, Sparkle is definitely red (means missing) and trying to "Show in Finder" does nothing coz, well, not found:
again as far as i'm aware i'm following the HowToBuild to the letter. (seems there's also libncurses missing but that's for another time.) if we can get iTerm to compile on my machines it's gonna be fun i think
Ah shoot, I forgot to push a change to that submodule. Try again.
ok so the submodules worked, but there's still Sparkle missing. not sure how things get installed in iTerm's project. in my apps everything is done through Swift Package Manager, and Xcode grabs everything when you open the packages. i guess iTerm is handled through pod or something? i have no experience with this, but if it's the case most probably it'd be good to have the command written in the HowToBuild?
there's another issue in one of the package regarding Apple IDs etc. but that may be related to the Sparkle missing so no need to bother with that yet.
Ah shoot, I forgot to push a change to that submodule. Try again.
will do.
I honestly have no idea what would happen if I changed kCGHIDEventTap to something else; it's been that way forever. I did modify the second argument for #10220 (closed) although I don't think it actually made a difference.
basically with the combination of Location and Placement, you have 6 places where you can listen to keystrokes and decide whether you want to use them and/or forward them down the stream or not. HID is the highest on the stream. it's like you can grab the keystrokes even before a user is logged in. HEAD will catch keystrokes before TAIL.
now the thing is, for example if Screen Sharing is tapping at the SESSION Location, then iTerm will steal the keystroke before it reaches Screen Sharing. in the case where Screen Sharing has a HID Location and TAIL Placement, like iTerm, it'll be up to which app has been started first lol. i know all that coz i had a lot of problems with my app kindaVim that, in order to add Vim motions everywhere, needs to catch all the keys etc. to make it work with other third party apps like Hammerspoon, BTT etc. i had to study how all that shit work.
anyways, in case that wasn't your question tho, and you were asking about how changing that Location would affect iTerm, well, i'm not sure. i think it should be pretty safe for iTerm to switch to a SESSION (even maybe ANNOTATEDSESSION?) Location because surely you don't need to catch events that early? or maybe you do, i don't know. in any case lemme grab the source and play with it and update you once i know more.
yeah don't think i'm gonna be able to run through Xcode. been following the HowToBuild doc: https://gitlab.com/gnachman/iterm2/-/wikis/HowToBuild
fatal: remote error: upload-pack: not our ref 6562fcc5cdc39c06b2b31f8dc3f2c46a71c22915
fatal: Fetched in submodule path 'submodules/iTerm2-shell-integration', but it did not contain 6562fcc5cdc39c06b2b31f8dc3f2c46a71c22915. Direct fetching of that commit failed.
when git submodule init and update tho
got the source and quick search on the event tap shows:
_machPort = CGEventTapCreate(kCGHIDEventTap,
kCGTailAppendEventTap,
you mentioned it shouldn't be related but just in case, cghidEventTap is the highest location đī¸, tailAppendEventTap is after existing taps at that location but still, that makes the whole tap the second highest possible on the list of all event taps that can be created. anyways i will try to run the source, generate the logs, play around and see what happens.
If you make a debug log do you see
EventHandler calledin it when the hotkey was pressed? I think it's unlikely that our event handler is called and then something weird happens, but it is always possible.
will check and report.
Another possible issue is with modifiers (cmd, opt, shift, control). VNC can be weird about what modifier flags get set. Can you tell if it works with some modifiers but not others?
if you mean trying a bunch of different modifiers on the local computer yeah i tried, all the same, they get captured by iTerm first on the local computer. honestly it just feels that in the event stream or whatever, iTerm just catches the keys first.
tbh it's not either a super super annoying issue. i think personally most of the time when i'll need to work on my remote computer through Screen Sharing, i'll probably not even need iTerm at that time and could just quit it to get the hotkey to go through VNC đī¸ but still, kinda curious. removing just that little bit of friction would still be nice. i'll check what i can do when i have time and will update you. thanks again George!
hmm i'm not sure from what you're saying and from the link to the source if you're talking about registering the hotkey or catching the hotkey press? coz i think the issue would be on catching the keystrokes themselves.
i have no knowledge about carbon keys and when i was building my apps i didn't want to bother with this as that KeyboardShortcuts package works really well (and it's from Sindre so high quality, heavily maintained etc.). but i'm definitely interested in digging into this and see if we can "improve" iTerm regarding this. although i'm not sure if everyone would like the hotkey to be working on the remote computer rather than the local one?
what i can tell you tho is that it's possible. definitely. i'm using Sindre's package for my apps and they all work through the VNC. the only one that doesn't is kV, that uses an event tap. (but i can ask kV to back off when using certain apps, which actually makes kV forward the key pressed through the VNC, and then kV catch them up on the remote. so all good.)
you can see that it works here:
when controlling another computer through some VNC (like built-in Screen Sharing), pressing the Hotkey Window keyboard shortcut will open iTerm on the host computer rather than the remote one. i think it'd be super nice to have iTerm open on the remote computer instead.
there's a couple of alternatives i can think of:
SOME APPS are doing this. for example Alfred. if you're on the remote machine, the Alfred keyboard shortcut will open Alfred on the remote rather than on the local. so it's possible.
i'm sure also that for its hotkey keyboard shortcut, Alfred doesn't use an event tap. i know because when macOS fucks up and locks a SecureInput (which iTerm beautifully let me know about), the hotkey still works (while the Alfred snippets don't coz they need an event tap to keep track of what's being typed).
oh now that i write about it i realize my own apps actually work too lol. i use the KeyboardShortcuts package from Sindre: https://github.com/sindresorhus/KeyboardShortcuts i know behind the scenes that it's dealing with some carbon keys blah blah blah but i haven't checked the implementation deeply. could do if you need me to and want some help. so when i use my own apps through VNC, they run on the remote computer rather than the local.
regarding the event tap, "maybe" there's a way to get the VNC tools like Screen Sharing to grab the Hotkey Window shortcut first by playing with the event tap location and placement? https://developer.apple.com/documentation/coregraphics/cgevent/1454426-tapcreate# but tbh this is very sketchy because you don't control the location and placement set by third party apps for their own event taps.
same as usual. a little concerned that George is gonna turn crazy with all my reports. hope i'm not helping him with growing (more) white hair.
yeah my job was to report for what i wanted and thought would be a great addition to iTerm but as a fellow macOS developer i'm absolutely not surprised there may be a shitton of edge cases lol. well. definitely up to you to see if you wanna go down that road.
btw, my bad, if you extend the window with the mouse iTerm keeps the new column number. it doesn't if you resize through AX i.e. third party windows managers. i will update my first report above.
i've just liked my own issue because even if it's lame it's still doable.
would be super nice to have the ability to have iTerm take a certain percentage of the screen width rather than number of columns when using hotkey/visor mode. like for example when i'm on my MBA my setup is of course great, but when i have to use an external monitor at my shit client, then i would love for iTerm to take more screen estate rather than sticking to my 160 columns width. hope that makes sense!
the alternative is to use the mouse and extend the width of iTerm manually. BUT also most of the times it doesn't stick. once you hide and show iTerm again it goes back to the default number of columns one chose. the other alternative is to go set a new number of columns manually in your profile every time you connect to a new monitor. but i'd rather eat an apple laced with cyanide instead.
EDIT: made a mistake in the description above. iTerm DOES keep the new column number when the width is extended through the mouse. it does NOT when it's extended through third party window managers that use the AX to resize the window.
absolutely no concern except that this may give some extra work to George.