@@ -11,7 +11,6 @@ import {
1111 type TerminalSessionState ,
1212} from "@t3tools/client-runtime/state/terminal" ;
1313import {
14- Plus ,
1514 Pin ,
1615 Square ,
1716 SquareSplitHorizontal ,
@@ -49,6 +48,8 @@ import {
4948} from "react" ;
5049import { Popover , PopoverPopup , PopoverTrigger } from "~/components/ui/popover" ;
5150import { Button } from "~/components/ui/button" ;
51+ import { TerminalNewMenu } from "./TerminalNewMenu.fork" ; // fork-hook: zmux-estate/plain-shell-menu-import
52+ import { selectThreadTerminalUiState , useTerminalUiStateStore } from "../terminalUiStateStore" ; // fork-hook: zmux-estate/plain-shell-choice-import
5253import { PanelTabCloseButton } from "~/components/ui/panel-tab-close-button" ;
5354import { stackedThreadToast , toastManager } from "~/components/ui/toast" ;
5455import { readTextFromClipboard , writeTextToClipboard } from "~/hooks/useCopyToClipboard" ;
@@ -619,6 +620,11 @@ function TerminalSessionViewport({
619620 isTerminalUrl ( text ) || readEnvironmentScope ( environmentId , AuthOrchestrationOperateScope ) ,
620621 ) ;
621622 const attachmentId = useMemo ( ( ) => terminalAttachmentId ( terminalId ) , [ terminalId ] ) ;
623+ const plainShellFork = useTerminalUiStateStore (
624+ ( state ) =>
625+ selectThreadTerminalUiState ( state . terminalUiStateByThreadKey , threadRef )
626+ . plainShellByTerminalId ?. [ terminalId ] === true ,
627+ ) ; // fork-hook: zmux-estate/plain-shell-choice
622628 const serverConfig = useAtomValue ( serverEnvironment . configValueAtom ( environmentId ) ) ;
623629 const openInPreferredEditor = useOpenInPreferredEditor (
624630 environmentId ,
@@ -666,6 +672,7 @@ function TerminalSessionViewport({
666672 cwd,
667673 ...( worktreePath !== undefined ? { worktreePath } : { } ) ,
668674 ...( runtimeEnv ? { env : runtimeEnv } : { } ) ,
675+ ...( plainShellFork ? { plainShellFork } : { } ) , // fork-hook: zmux-estate/plain-shell-retarget-input
669676 } ,
670677 } ) ,
671678 ) ;
@@ -706,6 +713,7 @@ function TerminalSessionViewport({
706713 cwd,
707714 ...( worktreePath !== undefined ? { worktreePath } : { } ) ,
708715 ...( runtimeEnv ? { env : runtimeEnv } : { } ) ,
716+ ...( plainShellFork ? { plainShellFork } : { } ) , // fork-hook: zmux-estate/plain-shell-attach-input
709717 ...( providerInstanceId ? { providerInstanceId } : { } ) ,
710718 } ) ;
711719 // Attaching starts with the viewport, while the WASM surface is still loading;
@@ -1313,7 +1321,7 @@ interface ThreadTerminalDrawerProps {
13131321 activeTerminalGroupId : string ;
13141322 onSplitTerminal : ( ) => void ;
13151323 onSplitTerminalVertical : ( ) => void ;
1316- onNewTerminal : ( ) => void ;
1324+ onNewTerminal : ( plainShell ?: boolean ) => void ; // fork-hook: zmux-estate/plain-shell-drawer-action
13171325 splitShortcutLabel ?: string | undefined ;
13181326 splitVerticalShortcutLabel ?: string | undefined ;
13191327 newShortcutLabel ?: string | undefined ;
@@ -1814,9 +1822,9 @@ export default function ThreadTerminalDrawer({
18141822 if ( ! canOperateTerminal || hasReachedSplitLimit ) return ;
18151823 onSplitTerminalVertical ( ) ;
18161824 } ;
1817- const onNewTerminalAction = ( ) => {
1825+ const onNewTerminalAction = ( plainShell = false ) => { // fork-hook: zmux-estate/plain-shell-create-action
18181826 if ( ! canOperateTerminal ) return ;
1819- onNewTerminal ( ) ;
1827+ onNewTerminal ( plainShell ) ;
18201828 } ;
18211829 const confirmCloseTerminal = ( terminalId : string ) => {
18221830 if ( ! canOperateTerminal ) return ;
@@ -1949,11 +1957,21 @@ export default function ThreadTerminalDrawer({
19491957 < Button
19501958 size = "xs"
19511959 variant = "outline"
1952- onClick = { onNewTerminalAction }
1960+ onClick = { ( ) => onNewTerminalAction ( ) } // fork-hook: zmux-estate/plain-shell-empty-default
19531961 disabled = { ! canOperateTerminal }
19541962 >
19551963 { newTerminalActionLabel }
19561964 </ Button >
1965+ { /* fork-hook: zmux-estate/plain-shell-empty-menu */ }
1966+ < Button
1967+ size = "xs"
1968+ variant = "outline"
1969+ disabled = { ! canOperateTerminal }
1970+ onClick = { ( ) => onNewTerminalAction ( true ) }
1971+ >
1972+ New plain shell
1973+ </ Button >
1974+ { /* fork-hook-end */ }
19571975 </ div >
19581976 </ aside >
19591977 ) ;
@@ -2023,14 +2041,13 @@ export default function ThreadTerminalDrawer({
20232041 onModeChange = { onCheckoutModeChange }
20242042 />
20252043 < div className = "h-4 w-px bg-border/80" />
2026- < TerminalActionButton
2044+ { /* fork-hook: zmux-estate/plain-shell-floating-menu */ }
2045+ < TerminalNewMenu
20272046 disabled = { ! canOperateTerminal }
2028- className = "p-1 text-foreground/90 transition-colors hover:bg-accent"
2029- onClick = { onNewTerminalAction }
2047+ onNewTerminal = { onNewTerminalAction }
20302048 label = { newTerminalActionLabel }
2031- >
2032- < Plus className = "size-3.25" />
2033- </ TerminalActionButton >
2049+ />
2050+ { /* fork-hook-end */ }
20342051 < div className = "h-4 w-px bg-border/80" />
20352052 < TerminalActionButton
20362053 disabled = { ! canOperateTerminal }
@@ -2106,14 +2123,13 @@ export default function ThreadTerminalDrawer({
21062123 disabled = { checkoutModeChangeDisabled }
21072124 onModeChange = { onCheckoutModeChange }
21082125 />
2109- < TerminalActionButton
2126+ { /* fork-hook: zmux-estate/plain-shell-sidebar-menu */ }
2127+ < TerminalNewMenu
21102128 disabled = { ! canOperateTerminal }
2111- className = "inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70"
2112- onClick = { onNewTerminalAction }
2129+ onNewTerminal = { onNewTerminalAction }
21132130 label = { newTerminalActionLabel }
2114- >
2115- < Plus className = "size-3.25" />
2116- </ TerminalActionButton >
2131+ />
2132+ { /* fork-hook-end */ }
21172133 < TerminalActionButton
21182134 disabled = { ! canOperateTerminal }
21192135 className = "inline-flex h-full items-center border-l border-border/70 px-1 text-foreground/90 transition-colors hover:bg-accent/70"
0 commit comments