johns325
By:
johns325

copy and paste into console

May 2, 2016 6.8k views
Control Panels API

How do you copy and paste into the console?

2 comments
  • Neither of these solutions worked for me. When I right click in the console window, opened from my panel, nothing happens. Am I missing something?

    Any help is appreciated, thanks.

    buzz

  • Same problem, i am not able to paste contents into digital ocean console. tried both the options. This is my first time logging in, already my experience is bad. If this is not addressed right away, i need to bail out.

10 Answers

NOTHING works on Digitalocean anymore. YOU can't copy paste, the console window is NOT scrollable with FF, Safari and Chrome. SSH Login from droplets don't work evenso pinging is good, DIGITALOCEAN GETS WORSE AND WORSE. They changed, they know have incompetent staff, wrong people in charge for Keytechnology, trying to optimise cost structure etcetera. The divers issue atm with DO makes me run away. I think it will not get better but more worse in future...

  • This is very irritating as I have long passwords stored in my password manager. Not going to type those in manually, so the console is kind of useless to me.

What I can share is how to paste command lines in the console.

  1. Copy the console URL and paste it to a new window.
    ex. https://cloud.digitalocean.com/droplets/111111111/console?no_layout=true.

  2. Open Developer Tools then click Console tab

  3. Copy and paste the codes below. Taken from stackoverflow

    var sendString = (function(rfb, force, sendDelay) { 
    sendDelay = sendDelay || 25;
    var _q = [];
    var _qStart = function() {
    var chr = _q.shift();
    if (chr) {
      rfb.sendKey(chr);
      setTimeout(_qStart, sendDelay);
    }
    };
    var _qStop = function() { _q.length = 0; };
    var fn = function sendString(str) {
    _qStop();
    str = str || '';
    var chr;
    for (var i=0; i < str.length; i++) {
      chr = str[i].charCodeAt();
      _q.push(chr);
    }
    _qStart();
    };
    if (rfb.sendString && true !== force) {
    console.warn('rfb.sendString not installed because it already exists.  Use force if you\'d like');
    }
    else {
    rfb.sendString = fn;
    }
    return fn;
    })(rfb);
    
  4. On the same console type sendString("Commandline to be pasted in the console")

Let's try to REQUIRE DIGITAL OCEAN to change it's UGLY interface: no one works today without copy/paste.

To copy, right-click on console window and select, after Ctrl+C. Right click in console window and select Paste.

I'm assuming your are talking about the console on DigitalOcean's (your) panel but just in case terminal window was the subject of your request.

ctrl+shif+v

Should allow you to paste into a terminal window.

Hopefully Mr. Gimme Gimme got his answer here, thanks @Elizine from @johns325

This is a joke, there is no way to paste on the console?! :-/

This is utter rubbish, everyone needs cut n paste. I am disabled and find typing fast hard. I cannot even type my DO first password in its way to fast. Are DO willing to loose customers because there not disabled friendly! so annoyed.

Yeah, that's really annoying.

The only way to bypass this is to use an external ssh client like putty. It allows you to copy and paste.

1) Enter the root password
2) Copy the password from your mail
3) Right click beside "password:"

Note, that you do not see the pasted password.

It seems DO wants us to use SSH keys instead passwords

The code by @mikaelvg works. Its a bit irritating to add the code in the begining, but after that you can just use the paste function kind of normally and it goes through. Its still better than typing all the code by hand. I wish digitalocean had a console similar to cloudways.

Anways For those of you who didn't figure it out, here is what you have to do. Click on the console link from the control panel of digitial ocean, it will be a separate window but inspector doesn't work there. So you will have to copy the link and paste it in a new tab in chrome. Then right click > inspect, inside inspector click on the console tab, and paste the code @mikaelvg shared.

Have another answer? Share your knowledge.