Skip to content

Commit bf43dc4

Browse files
committed
- ShellConfigurator: better detect writable terminal
1 parent ebacaa1 commit bf43dc4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/ShellConfigurator.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ type ShellConfig = Partial<{
66
workdir: string
77
}>;
88

9+
let observedProcess = false;
10+
911
export const ShellConfigurator: React.FC = () => {
1012
const boot = useStore(tutorialStore.bootStatus);
1113
const storeRef = useStore(tutorialStore.ref);
@@ -38,10 +40,10 @@ export const ShellConfigurator: React.FC = () => {
3840
const { workdir } = conf;
3941
if (!workdir) return;
4042

41-
terminal.input(`cd /home/tutorial${workdir} && clear\n`);
42-
4343
const checkProcess = () => {
44-
if (terminal.process) {
44+
console.log('Checking process...', terminal.process, observedProcess);
45+
if (terminal.process || observedProcess) {
46+
if (!observedProcess) observedProcess = true;
4547
terminal.input(`cd /home/tutorial${workdir} && clear\n`);
4648
return true;
4749
}

0 commit comments

Comments
 (0)