nitin42 / terminal-in-react

👨‍💻 A component that renders a terminal
http://terminal-in-react.surge.sh/
MIT License
2.12k stars 151 forks source link

How can i change terminal window size? #98

Closed PedroNestor2077 closed 3 years ago

Neffez commented 3 years ago

You can set the height and width in the style attributes of the wrapper div and the Terminal element, for example (see "height"):


    return (
      <div
        style={{
          height: "50vh"
        }}
      >
        <Terminal
          color='green'
          backgroundColor='black'
          barColor='black'
          style={{ fontWeight: "bold", fontSize: "1em", height: "50vh" }}
          commands={{
            'open-google': () => window.open('https://www.google.com/', '_blank'),
            showmsg: this.showMsg,
            popup: () => alert('Terminal in React')
          }}
          descriptions={{
            'open-google': 'opens google.com',
            showmsg: 'shows a message',
            alert: 'alert', popup: 'alert'
          }}
          msg='You can write anything here. Example - Hello! My name is Foo and I like Bar.'
        />
      </div>
    );
  }