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

Slash Commands for keybindings #441

Merged
merged 11 commits into from
Mar 14, 2024
Merged

Slash Commands for keybindings #441

merged 11 commits into from
Mar 14, 2024

Conversation

MrStashley
Copy link

@MrStashley MrStashley commented Mar 13, 2024

First draft, I put in the keybindings that work out of the box with slash commands, and I am working on the others

Theoretically, multiple commands should work out of the box with this system, although I think the \n syntax might look a little wierd, maybe , separator is better

I couldn't get remote:show or client:show to work correctly. Maybe I'm using them incorrectly? It seems like remote:show didn't do anything when typed into the 0.7.0 prod release either

@@ -3560,6 +3563,45 @@ func SessionSetCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (s
return update, nil
}

func SleepCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus.UpdatePacket, error) {
Copy link
Author

@MrStashley MrStashley Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this
For my slash command "scripts" it waits until the http call returns before running the next one, there is no update or anything, so for now at least, sleep has to lock the current process. I think this isn't too big a deal because we are already running inside of a goroutine? but either way I didn't end up using this so I can delete it if it seems sketchy
Added a max value of 1000 ms

},
{
"command": "app:newTab",
"keys": ["Cmd:t"]
},
{
"command": "app:focusCmdInput",
"keys": ["Cmd:i"]
"keys": ["Cmd:i"],
"commandStr":"/mainview session,/screen:set focus=cmd,/screen:set focus=input"
Copy link
Author

@MrStashley MrStashley Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using , separator, whitespace or \n is allowed and ignored

@MrStashley
Copy link
Author

Should I remove the dev tools accelerator?
Our toggle dev tools works, but it has the one quirk where you can't close it if you are focused on the dev tools, ie you have to click on the wave window with your mouse before the document key bindings work again

@sawka sawka merged commit f87cc42 into main Mar 14, 2024
3 of 5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants