({
commands: initialCommands,
debug,
initialTools,
initialMessages,
pendingHookMessages,
initialFileHistorySnapshots,
initialContentReplacements,
initialAgentName: _initialAgentName,
initialAgentColor: _initialAgentColor,
mcpClients: initialMcpClients,
dynamicMcpConfig: initialDynamicMcpConfig,
autoConnectIdeFlag,
strictMcpConfig = false,
systemPrompt: customSystemPrompt,
appendSystemPrompt,
onBeforeQuery,
onTurnComplete,
disabled = false,
mainThreadAgentDefinition: initialMainThreadAgentDefinition,
disableSlashCommands = false,
taskListId,
remoteSessionConfig,
directConnectConfig,
sshSession,
thinkingConfig,
}: Props)
| 829 | } |
| 830 | |
| 831 | export function REPL({ |
| 832 | commands: initialCommands, |
| 833 | debug, |
| 834 | initialTools, |
| 835 | initialMessages, |
| 836 | pendingHookMessages, |
| 837 | initialFileHistorySnapshots, |
| 838 | initialContentReplacements, |
| 839 | initialAgentName: _initialAgentName, |
| 840 | initialAgentColor: _initialAgentColor, |
| 841 | mcpClients: initialMcpClients, |
| 842 | dynamicMcpConfig: initialDynamicMcpConfig, |
| 843 | autoConnectIdeFlag, |
| 844 | strictMcpConfig = false, |
| 845 | systemPrompt: customSystemPrompt, |
| 846 | appendSystemPrompt, |
| 847 | onBeforeQuery, |
| 848 | onTurnComplete, |
| 849 | disabled = false, |
| 850 | mainThreadAgentDefinition: initialMainThreadAgentDefinition, |
| 851 | disableSlashCommands = false, |
| 852 | taskListId, |
| 853 | remoteSessionConfig, |
| 854 | directConnectConfig, |
| 855 | sshSession, |
| 856 | thinkingConfig, |
| 857 | }: Props): React.ReactNode { |
| 858 | const isRemoteSession = !!remoteSessionConfig; |
| 859 | |
| 860 | // Env-var gates hoisted to mount-time — isEnvTruthy does toLowerCase+trim+ |
| 861 | // includes, and these were on the render path (hot during PageUp spam). |
| 862 | const titleDisabled = useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_TERMINAL_TITLE), []); |
| 863 | const moreRightEnabled = useMemo( |
| 864 | () => process.env.USER_TYPE === 'ant' && isEnvTruthy(process.env.CLAUDE_MORERIGHT), |
| 865 | [], |
| 866 | ); |
| 867 | const disableVirtualScroll = useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL), []); |
| 868 | const disableMessageActionsRaw = useMemo(() => isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_MESSAGE_ACTIONS), []); |
| 869 | const disableMessageActions = feature('MESSAGE_ACTIONS') ? disableMessageActionsRaw : false; |
| 870 | |
| 871 | // Log REPL mount/unmount lifecycle |
| 872 | useEffect(() => { |
| 873 | logForDebugging(`[REPL:mount] REPL mounted, disabled=${disabled}`); |
| 874 | return () => logForDebugging(`[REPL:unmount] REPL unmounting`); |
| 875 | }, [disabled]); |
| 876 | |
| 877 | // Agent definition is state so /resume can update it mid-session |
| 878 | const [mainThreadAgentDefinition, setMainThreadAgentDefinition] = useState(initialMainThreadAgentDefinition); |
| 879 | |
| 880 | const toolPermissionContext = useAppState(s => s.toolPermissionContext); |
| 881 | const verbose = useAppState(s => s.verbose); |
| 882 | const mcp = useAppState(s => s.mcp); |
| 883 | const plugins = useAppState(s => s.plugins); |
| 884 | const agentDefinitions = useAppState(s => s.agentDefinitions); |
| 885 | const fileHistory = useAppState(s => s.fileHistory); |
| 886 | const initialMessage = useAppState(s => s.initialMessage); |
| 887 | const queuedCommands = useCommandQueue(); |
| 888 | // feature() is a build-time constant — dead code elimination removes the hook |
nothing calls this directly
no test coverage detected