Skip to content

Instantly share code, notes, and snippets.

@Lokno
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lokno/e04a4ef89141727c5607 to your computer and use it in GitHub Desktop.
Save Lokno/e04a4ef89141727c5607 to your computer and use it in GitHub Desktop.
Extends ctrl+c and ctrl+v copy/paste shortcuts to terminals
; Enables ctrl+c and ctrl+v for command line terminals
; Escape is used in the place of the ctrl+c interrupt
$^c::
if WinActive("ahk_class ConsoleWindowClass") or WinActive("ahk_class PuTTY")
{
SendInput {Enter}
}
else
{
SendInput ^c
}
return
$^v::
if WinActive("ahk_class ConsoleWindowClass") or WinActive("ahk_class PuTTY")
{
SendInput {RButton}
}
else
{
SendInput ^v
}
return
$Esc::
if WinActive("ahk_class ConsoleWindowClass") or WinActive("ahk_class PuTTY")
{
SendInput ^c
}
else
{
SendInput {Esc}
}
return
; BONUS : uncomment to ignore ctrl+s in terminals
; $^s::
; if !WinActive("ahk_class ConsoleWindowClass") and !WinActive("ahk_class PuTTY")
; {
; SendInput ^s
; }
; return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment