question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't use more than 1 terminal on a web page

See original GitHub issue

I create X terminal on my webpage (each are a different one) but I can’t swap from one to one. I mean if I open A then B I can’t come back in A I’ll stay in B.

This video show the issue.

This is my code to create a Terminal for each time I click on a button:

window["term_" + _idContainer] = new Terminal({
                cursorBlink: true,
});

where _idContainer is the id of the container where I click “open terminal”.

Details

  • Browser and browser version: Chrome latest
  • OS version: macOS Sierra
  • xterm.js version: 2.3.2

Steps to reproduce

  1. Open 2 terminal on a web page
  2. Try to swap form A to B to A

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pariskcommented, Mar 6, 2017

There is no build-in way to assign an “id” to an xterm instance.

1reaction
pariskcommented, Mar 2, 2017

@JeromeVi I can’t go through your own application’s code to understand what’s the problem.

What I suggest is create a couple of terminals statically:

var termA = new Terminal();
var termB = new Terminal();

// I assume that the elements below exist
termA.open(document.getElementById('terminal-a'));
termB.open(document.getElementById('terminal-b'));

And then experiment on top of these. There are applications that already use multiple instances of xterm.js, so unless there is a JavaScript error thrown, I think you should take a closer, patient, step-by-step look into your code base 🙂 .

Closing this, as there is not much we can do right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to display more than 1 terminal simultaneously
Just resize your terminal windows, so they all fit a corner of the screen. The Terminal can also have tabs, which might help...
Read more >
Open new Terminal windows and tabs on Mac
Choose Terminal > Settings, then click Profiles. In the profiles list, double-click the icon for the profile you want to use. Open new...
Read more >
5 ways to split your Linux terminal
The only answer is a split screen so that two or more terminals can exist at the same time within just one application...
Read more >
Multiple Terminal Panes with tmux
Using several terminal tabs is a common way to work so you can switch between different tasks. When you aren't developing with containers,...
Read more >
The Unresponsive Terminal - Learning the UNIX Operating ...
If this works, your terminal needs to be reset to fix the RETURN key. Some systems have a reset command that you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found