[bugfix] compatible with WindowsTerminal

This commit is contained in:
Klesh Wong 2021-07-08 22:14:13 +08:00
parent a173351e71
commit 72a181fcf5
2 changed files with 25 additions and 3 deletions

View File

@ -29,13 +29,29 @@ PasteAsUnixPath() {
PasteAs(convertFuncName) { PasteAs(convertFuncName) {
%convertFuncName%() %convertFuncName%()
Send ^v Paste()
Sleep 500 Sleep 500
} }
Copy() {
if WinActive("ahk_exe WindowsTerminal.exe") {
Send, ^+c
} else {
Send, ^c
}
}
Paste() {
if WinActive("ahk_exe WindowsTerminal.exe") {
Send, ^+v
} else {
Send, ^v
}
}
CopyAndFetch() { CopyAndFetch() {
Clipboard = Clipboard =
Send, ^c ; simulate Ctrl+C (=selection in clipboard) Copy()
ClipWait, 0, 1 ; wait until clipboard contains data ClipWait, 0, 1 ; wait until clipboard contains data
selection = %Clipboard% ; save the content of the clipboard selection = %Clipboard% ; save the content of the clipboard
return selection return selection
@ -58,3 +74,8 @@ LoadAlternativeToClipboard() {
global ALTERNATIVE_CLIPBOARD global ALTERNATIVE_CLIPBOARD
Clipboard = %ALTERNATIVE_CLIPBOARD% Clipboard = %ALTERNATIVE_CLIPBOARD%
} }
CopyClipboardToAlternative() {
global ALTERNATIVE_CLIPBOARD
ALTERNATIVE_CLIPBOARD = %ClipBoardAll%
}

View File

@ -7,7 +7,7 @@ CoordMode, Mouse, Screen ; mouse coordinates relative to the screen
; ========================= ; =========================
; DEBUGGING ; DEBUGGING
; ========================= ; =========================
global DEBUGGING := true global DEBUGGING := false
ToggleDebugging() { ToggleDebugging() {
global DEBUGGING global DEBUGGING
@ -84,6 +84,7 @@ InitClipboardManager()
; CLIPBOARD MANAGER ; CLIPBOARD MANAGER
#c::AlternativeCopy() #c::AlternativeCopy()
#+c::CopyClipboardToAlternative()
#v::AlternativePaste() #v::AlternativePaste()