How to Copy and Paste in PuTTY
Many PuTTY users complain about not being able to copy and paste shell commands to and from the app’s interface. PuTTY supports both these functions. However, the problem lies in the fact that the copy/paste process itself is different from other apps.
In this article, you will learn how to copy and paste in PuTTY. But before that, let’s take a quick look at the program itself, its history, and its primary functions.
What Is PuTTY?
PuTTY is a popular client-side program available for Windows and Unix-like systems designed for use with the SHH, Rlogin, and Telnet network protocols. These protocols get used to securely run remote sessions between computers over an unsecured network, essentially allowing one computer to control another.
PuTTY was written by, and for the most part, is mostly still curated by British programmer, Simon Tatham, and is published under the MIT licensing scheme. The program’s first iteration was released to the public in January 1999, and for the last 20 years, it has been one of the go-to utilities for Windows admins looking for open-source software.
How Does It Work?
PuTTY is an interface for the client side of remote sessions. It only operates in the session where the information gets displayed, not on the machine that is running the session. It acts as if you are sitting at the computer you are communicating with, and typing directly into its command-line console.
It provides a visual interface through which you can issue commands and receive responses to another machine on your network, across different operating systems. There is a port for macOS in progress, and other unofficial ports exist for platforms like Windows Phone and Symbian, though there is still much work to be done on most of these projects.
While this client-side terminal can be beneficial, it can also lead to confusion, as your usual Windows keyboard commands will not have the function you expect. Ctrl+C, for example, would not serve the purpose of copying something to your clipboard. In fact, in many situations, it will end whatever command is currently getting processed, which is hardly ideal.
How to Copy Text from Windows to PuTTY
To copy text from Windows to PuTTY, follow these steps:
- Highlight the text in Windows.
- Press Ctrl+C or right-click the highlighted text and then left-click on Copy in the context menu.
- Left-click on the PuTTY window to select it.
- Right-click inside the PuTTY window where you want to paste the text or press Shift + Insert.
How to Copy Text from PuTTY to Windows
To copy text from Putty to your Windows clipboard, here’s what you need to do.
- Left-click inside the PuTTY terminal window near the text you want to copy.
- Holding down the left mouse button, drag your cursor across the text to select it.
- Release the mouse button to copy the content to your clipboard automatically.
- Left-click on the destination Windows application where the pasting will occur.
- Press Ctrl+V or right-click, then left-click on Paste in the context menu.
How to Copy Text Within PuTTY
If you want to copy text within PuTTY, here are the steps you need to follow:
- Place the cursor near the text you want to copy and left-click.
- Still holding the left mouse button, drag the cursor across the text you want to copy to highlight it.
- Release the mouse button to copy the text.
- Right-click on the terminal window where you want to paste the text or press Shift + Insert.
If you are using a text editor like Vi or Nano to work on a document, you can also use those programs’ cutting and pasting functionality to achieve the same end.
Setting PuTTY to Copy in Rich Text Format
By default, PuTTY doesn’t copy the formatting information included with the Rich Text Format as it can be inconvenient for its users. To enable this feature, do the following:
- Open the PuTTY application to access the initial configuration options.
- Click on the + next to Selection under the Window
- Click on Copy.
- Click the checkbox under “Formatting of copied characters.”
Useful Shortcuts When Copying from PuTTY
To copy a whole word or sequence of words, double-click the left mouse button before dragging the cursor to highlight what to copy.
To copy entire lines or sequences of lines, left-click three times before dragging the cursor.
PuTTY in Your Hands
PuTTY is one of the most popular clients for SHH, Rlogin, and Telnet. It has been justly criticized for having a pretty complicated interface and a rather steep initial learning curve. Using these simple methods, you can save yourself the frustration of accidentally ending a running command on the computer that you are communicating with.