How do you copy and paste into the console?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
I’m also finding this maddening- I need to add a new SSH key for the machine I’ve moved to, and there’s no way to easily move that information into the web console. Even creating a gist on GitHub creates a massive filename. It would be very useful to have a paste feature.
Hi, I have developed the following script based on another one, i lost its link
What I did is that I made it so it sends the whole text/cmd in one go also I added the ability to send line breaks when typing “\n” into the text, finally I made it so click enter at the end of each command.
The script is in a bookmarket format, just create a bookmarket and paste the following script into the address field
javascript: (function () {
var s = prompt("Enter text to be sent to console, (This wont send the enter keystroke)");
s = s.replace(/\\n/gi, String.fromCharCode(13));
var t = s.split("");
t.push(String.fromCharCode(13));
console.log(t);
var i = [];
t.forEach(f);
console.log(i);
rfb._sock.send(i);
function f(character) {
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1;
var shift = XK_Shift_L;
if (needs_shift) {
key(shift, 1);
}
key(code, 1);
key(code, 0);
if (needs_shift) {
key(shift, 0);
}
}
function key(keycode, down) {
i = i.concat(RFB.messages.keyEvent(h(keycode), down));
}
function h(e) {
switch (e) {
case 13:
return XK_Return;
default:
return e;
}
}
})();
Hi. Easiest solution if you’re a Chrome user is to add Secure Shell or Termius or FireSSH extension and access your server via one of these console. Copy Paste Cut work fine (same on Firefox).
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.