Skip to content

Commit

Permalink
revert clearTerminal
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Aug 20, 2024
1 parent d0aba23 commit 0132a92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions frontend/src/components/AgentControlBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { clearMessages } from "#/state/chatSlice";
import { clearCells } from "#/state/jupyterSlice";
import Session from "#/services/session";
import { clearCommands } from "#/state/commandSlice";
import { useTerminal } from "#/hooks/useTerminal";
import { clearCurentStep } from "#/state/agentSlice";

const IgnoreTaskStateMap: { [k: string]: AgentState[] } = {
Expand Down Expand Up @@ -81,8 +80,7 @@ function AgentControlBar() {
const { curAgentState } = useSelector((state: RootState) => state.agent);
const [desiredState, setDesiredState] = React.useState(AgentState.INIT);
const [isLoading, setIsLoading] = React.useState(false);
const { clearTerminal } = useTerminal([]);

// const { clearTerminal } = useTerminal([]);

const handleAction = (action: AgentState) => {
if (IgnoreTaskStateMap[action].includes(curAgentState)) {
Expand All @@ -98,7 +96,7 @@ function AgentControlBar() {
store.dispatch(clearCells());
store.dispatch(clearCommands());
store.dispatch(clearCurentStep());
clearTerminal();
// clearTerminal();
} else {
setIsLoading(true);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const useTerminal = (commands: Command[] = []) => {
const fitAddon = React.useRef<FitAddon | null>(null);
const ref = React.useRef<HTMLDivElement>(null);
const lastCommandIndex = React.useRef(0);
let lastCommand = React.useRef("");
const lastCommand = React.useRef("");

React.useEffect(() => {
/* Create a new terminal instance */
Expand Down

0 comments on commit 0132a92

Please sign in to comment.