Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It appears "allowTabs" does not work #81

Open
jloveric opened this issue Dec 13, 2019 · 3 comments
Open

It appears "allowTabs" does not work #81

jloveric opened this issue Dec 13, 2019 · 3 comments

Comments

@jloveric
Copy link

It seems the "allowTabs" option, setting to true or false does nothing? Whether it's set to true or false, you can still add new tabs. Also is there a way to get rid of the tab bar completely? I was thinking allowTabs would do that.

@jloveric
Copy link
Author

jloveric commented Dec 13, 2019

Ok, some very strange things are happening. The tab starts out saying "bash", but if I type a command, "Holy cow" say, and move to a different browser tab then back to the browser tab containing the terminal then where there was once "bash" it now says "Holy". This is a super simple app with nothing more than the Terminal.

  1. Create simple terminal app and go to the browser to view.
  2. The tab should say "bash"
  3. type something in the command "Holy Cow" - the command has to have at least 2 words it seems
  4. go to a different browser tab and come back to the tab containing the terminal
  5. The tab that said "bash" now says "Holy".

Could be a bug in one of the dependencies. Here is the code - I'm using the pass though.

import React, { Component } from 'react';
import Terminal from 'terminal-in-react';
import './App.css';

function App() {
  return (
    
        <Terminal
          hideTopBar='true'
          allowTabs='true'
          startState="maximised"
          color='green'
          backgroundColor='black'
          barColor='black'
          style={{ fontWeight: "bold", fontSize: "1em", width: "100%" }}
          commandPassThrough={cmd => { 
            return `You said ${cmd.join(' ')}! `
          }}
          msg='Hello World
        />
      
    );
  
}
export default App;

Terminal1
Terminal2

@jloveric
Copy link
Author

For now you can visit https://jloveric.github.io/ to see what I'm talking about as I have the terminal example running there.

@camisatx
Copy link

camisatx commented Feb 3, 2020

Try putting your boolean based variables within curly brackets, like this:

<Terminal
  hideTopBar={true}
  allowTabs={true}
/>

Otherwise React detects them as strings and not booleans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants