Closed AriPerkkio closed 1 month ago
terminal.write
import tutorialStore from 'tutorialkit:store'; export default function Example() { async function onClick() { const terminal = tutorialStore.terminalConfig.value!.panels[0]; terminal.input('npm run test\n'); } return ( <button onClick={onClick} className="px-4 py-1 my-3 cursor-pointer border-1 border-tk-border-primary rounded-md bg-tk-elements-primaryButton-backgroundColor text-tk-elements-primaryButton-textColor" > Run tests </button> ); }
Run & review this pull request in StackBlitz Codeflow.
terminal.write
cannot be used to write into terminal's stdin. It's only useful for writing to stdout.