react-terminal icon indicating copy to clipboard operation
react-terminal copied to clipboard

Programatically run commands

Open benmneb opened this issue 4 years ago • 1 comments

Is it possible to run commands or just print things to the terminal without actually typing in a command? At the moment the following code runs (console.log works), but just doesnt print anything in the terminal. Seems unusual.

Example:

const welcomeMessage = (
    <span>
        <span style={link} onClick={() => commands.copy()}>
          Click here
        </span>{" "}
        to try to run a function to print to terminal.
      </span>
  );

const commands = {
    copy: () => {
      console.log("success?");
      return <span>Success!</span>;
    }
  };

EDIT ON CODESANDBOX

benmneb avatar Aug 26 '21 09:08 benmneb

Seems realsted to https://github.com/bony2023/react-terminal/issues/173

bitcoinbrisbane avatar Sep 24 '22 10:09 bitcoinbrisbane

feature added in https://github.com/bony2023/react-terminal/pull/233

bony2023 avatar Nov 09 '23 13:11 bony2023