diff --git a/frontend/src/components/terminal/container.tsx b/frontend/src/components/terminal/container.tsx index 1ae437329..339769790 100644 --- a/frontend/src/components/terminal/container.tsx +++ b/frontend/src/components/terminal/container.tsx @@ -42,8 +42,8 @@ export const ContainerTerminal = ({ "sh" ); const [mode, setMode] = useLocalStorage( - `${storageKey}-term-mode-v1`, - Types.ContainerTerminalMode.Attach + `${storageKey}-term-mode-v2`, + Types.ContainerTerminalMode.Exec ); const [otherShell, setOtherShell] = useState(""); @@ -68,76 +68,74 @@ export const ContainerTerminal = ({
- - docker - - {mode === Types.ContainerTerminalMode.Exec ? "-it " : ""}container - + setMode(mode as Types.ContainerTerminalMode) + } + > + + + + + + {Object.values(Types.ContainerTerminalMode).map((mode) => ( + + {mode} + + ))} + + + + {mode === Types.ContainerTerminalMode.Exec ? "-it " : ""}container + setOtherShell(e.target.value)} - onKeyDown={(e) => { - if (e.key === "Enter") { - setShell(otherShell); - setOtherShell(""); - } else { - e.stopPropagation(); - } - }} - /> - - - - + + + + + {[ + ...BASE_SHELLS, + ...(!BASE_SHELLS.includes(shell) ? [shell] : []), + ].map((shell) => ( + + {shell} + + ))} + setOtherShell(e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + setShell(otherShell); + setOtherShell(""); + } else { + e.stopPropagation(); + } + }} + /> + + + - + } >