Are you tired of constantly switching between your keyboard and mouse to paste text into non-CMD terminals? This article will guide you through creating an AutoHotkey (AHK) script to make pasting text using the Control+v shortcut easier in Bash, PuTTY, Windows Subsystem for Linux (WSL), and other non-CMD terminals.
What is AutoHotkey?
AutoHotkey is a powerful scripting language for automating tasks in Windows. It allows you to create custom keyboard shortcuts, automate repetitive tasks, and control windows and applications with hotkeys and scripts.
Why Create an AHK Script for Control+v in Non-CMD Terminals?
By default, the Control+v shortcut is not available in many non-CMD terminals, such as Bash, PuTTY, and WSL. Creating an AHK script to map this shortcut can save you time and make your workflow more efficient.
Creating the AHK Script
To create an AHK script for Control+v in non-CMD terminals, follow these steps:
- Download and install the latest version of AutoHotkey from https://www.autohotkey.com/.
- Create a new text file and save it with the extension
.ahk. - Add the following code to the file:
#IfWinActive, PuTTY ^v:: Send, ^v return #IfWinActive, Bash ^v:: Send, ^v return #IfWinActive, Windows Terminal ^v:: Send, ^v return #IfWinActive, Ubuntu ^v:: Send, ^v returnThis script maps the Control+v shortcut to the same shortcut in PuTTY, Bash, Windows Terminal, and Ubuntu. You can add more terminals to the script by copying and pasting the corresponding lines and modifying the window title.
Running the AHK Script
To run the AHK script, double-click the file. The script will run in the background, and you can use the Control+v shortcut in any of the specified terminals.
Troubleshooting
If the script does not work, make sure that the window titles in the script match the titles of your terminals. You can check the window title by hovering over the terminal window title bar.
Creating an AHK script for Control+v in non-CMD terminals can save you time and make your workflow more efficient. By following the steps in this article, you can create a script that maps the Control+v shortcut to the same shortcut in PuTTY, Bash, Windows Terminal, and Ubuntu.
References
Title URL AutoHotkey https://www.autohotkey.com/ PuTTY https://www.putty.org/ Windows Subsystem for Linux https://docs.microsoft.com/en-us/windows/wsl/