ssmlee07
By:
ssmlee07

how to open 2 console window at the same time

July 13, 2015 2.1k views
Node.js

my app structure is as follows:
app
- backend
- server.js (start this by doing NODEENV=production grunt)
- frontend
- server.js (start this by doing NODE
ENV=production grunt)

the thing is on the console window I can only run one script. So is there a way that I can have 2 (virtual) consoles that login to the same instance? Thanks.

5 Answers

Yes. You cannot just open the console in two different browser windows because the console acts as the local keyboard and display for your droplet and will display the same session in each browser window. You can instead use one of these options:

1.) Using ssh. You can have two open ssh sessions open and run different tasks in them
2.) Use screen. This tool allows you to launch a new session, run some code and leave it running and use a keyboard shortcut to disconnect from the session.

by Justin Ellingwood
In this article, we will discuss how to install and use "screen", a tool that allows you to manage multiple shell sessions inside a single terminal. The screen program is very useful for multi-tasking in an ssh environment, due to its ability to resume terminal sessions and perform multiple-concurrent tasks.
  • I used ssh but when I close the ssh the server just stopped..

  • screen seems to be the solution but it seems I cannot use screen in the virtual console?

  • solved my issue by doing
    screen -r (to reattach screen session upon ssh login)
    screen -n (jump to next screen)
    screen -c (create screen)
    screen -d (detach screen service and keep it running)

    Thanks a million

Welcome to DigitalOcean.

The Question is what OS and Application you use to login via SSH?

In Windows (Putty) you click on the nice icon on the left side and click on "New Session".

Mac OS X and Linux are easy, you just open a new Terminal and do this:

ssh username@IP_OF_DROPLET

I suggest you use screen, this is very usefull and you can detach and attach to this screen whenever you want. You can also use these screen scripts on startup, so your app runs automatically.

  • screen seems to be the solution but it seems I cannot use screen in the virtual console?

  • solved my issue by doing
    screen -r (to reattach screen session upon ssh login)
    screen -n (jump to next screen)
    screen -c (create screen)
    screen -d (detach screen service and keep it running)

    Thanks a million

Could be possible, but its not a big issue. Just download putty, login to your server with root and your password and you got the same setup but in a program.

In putty you can use the screen command. What do you mean with "the server just stopped"?
Does it reboot the server or shut it down?

Have another answer? Share your knowledge.