-
Notifications
You must be signed in to change notification settings - Fork 442
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
Per shell keyboard shortcuts #45
Conversation
Still to do: - MUST ensure that the keyboard shortcut handlers are registered for the shell's command when a new shell is added (this requires that the ShellProfileViewModel, or at least SettingsService, has access to teh KeyboardCommandService and RegisterCommandHandler. - Without this, currently if you add a shell, then add a keyboard shortcut without reloading the app, attempts to use that shortcut will cause an exception as no handler is registered for that command ID yet. - SHOULD ensure that when shells are removed that their associated commands are removed from the keyboard command handler. - This will reqire adding a DeregisterCommandHandler() funciton to the KeyboardCommandService. - CAN probably change the shell IDs from GUIDs to match the command IDs, as those will be unique anyway, just not shared across installs.
I would really prefer going for a solution that does not rely on KeyBinding/Command. There is a lot of code added that just implicates that we are reusing something here that was not meant for this. If we go for ProfileKeyBinding we can give the model a an empty List as a default for both existing defaults and custom shells. That way we don't have to change any Ids of the default shells. The XAML part is something I can take care of, should be no big deal. We can stick to the Edit/Save workflow by adding a readonly mode to the KeyBindingView. I can make a PR on your fork once we got there. |
So a couple questions:
At the core of it, this is getting sticky I think because we're conflating a compile-time concept (a static list of actions we can invoke from the keyboard) with a runtime-concept (the list of shells we have available to invoke new tabs with). This implementation of shell shortcuts is definitely suboptimal, because I'm trying to use a system designed for the former for the latter, but I don't think it's the keybindings that need to change so much as the actions themselves. I may be wrong there. |
Yes, ultimatively that's the problem. My point is that if we already store and handle them quite differently, we might also use some subtyping to better express their differentness. So yeah, the keybindings need to change, but we shouldn't change so much of the existing handling for the command keybindings. |
This needs a major rewrite, given changes to the app since this initial implementation. I'm closing this, and will open a new one when I get to working on that feature. |
There are several architectural discussions to have on this PR:
There are a couple breaking changes:
Discussion points:
Notes: