@@ -58,6 +58,8 @@ import { isGitpodIo } from "../utils";
58
58
59
59
type NextLoadOption = "searchParams" | "autoStart" | "allDone" ;
60
60
61
+ export const StartWorkspaceKeyBinding = `${ / ( M a c | i P h o n e | i P o d | i P a d ) / i. test ( navigator . platform ) ? "⌘" : "Ctrl﹢" } Enter` ;
62
+
61
63
export function CreateWorkspacePage ( ) {
62
64
const { user, setUser } = useContext ( UserContext ) ;
63
65
const updateUser = useUpdateCurrentUserMutation ( ) ;
@@ -429,6 +431,21 @@ export function CreateWorkspacePage() {
429
431
return false ;
430
432
} , [ autostart , contextURL , errorIde , errorWsClass , workspaceContext . error , workspaceContext . isLoading ] ) ;
431
433
434
+ useEffect ( ( ) => {
435
+ const onKeyDown = ( event : KeyboardEvent ) => {
436
+ if ( ( event . metaKey || event . ctrlKey ) && event . key === "Enter" ) {
437
+ if ( ! continueButtonDisabled ) {
438
+ event . preventDefault ( ) ;
439
+ onClickCreate ( ) ;
440
+ }
441
+ }
442
+ } ;
443
+ window . addEventListener ( "keydown" , onKeyDown ) ;
444
+ return ( ) => {
445
+ window . removeEventListener ( "keydown" , onKeyDown ) ;
446
+ } ;
447
+ } , [ continueButtonDisabled , onClickCreate ] ) ;
448
+
432
449
if ( SelectAccountPayload . is ( selectAccountError ) ) {
433
450
return (
434
451
< SelectAccountModal
@@ -546,7 +563,9 @@ export function CreateWorkspacePage() {
546
563
loading = { createWorkspaceMutation . isStarting || ! ! autostart }
547
564
disabled = { continueButtonDisabled }
548
565
>
549
- { createWorkspaceMutation . isStarting ? "Opening Workspace ..." : "Continue" }
566
+ { createWorkspaceMutation . isStarting
567
+ ? "Opening Workspace ..."
568
+ : `Continue (${ StartWorkspaceKeyBinding } )` }
550
569
</ LoadingButton >
551
570
</ div >
552
571
{ existingWorkspaces . length > 0 && ! createWorkspaceMutation . isStarting && (
0 commit comments