mirror of
https://github.com/tstack/lnav
synced 2024-11-17 15:29:40 +00:00
Support for Windows Subsystem for Linux clipboard command
This commit is contained in:
parent
062d480fea
commit
ba48d31120
@ -48,6 +48,11 @@ static clip_command *get_commands()
|
|||||||
{ { "pbcopy -pboard find > /dev/null 2>&1",
|
{ { "pbcopy -pboard find > /dev/null 2>&1",
|
||||||
"pbpaste -pboard find -Prefer txt 2>/dev/null" } },
|
"pbpaste -pboard find -Prefer txt 2>/dev/null" } },
|
||||||
};
|
};
|
||||||
|
static clip_command WINDOWS_CMDS[] = {
|
||||||
|
{ { "clip.exe > /dev/null 2>&1",
|
||||||
|
nullptr } },
|
||||||
|
{ { nullptr, nullptr } },
|
||||||
|
};
|
||||||
static clip_command X_CMDS[] = {
|
static clip_command X_CMDS[] = {
|
||||||
{ { "xclip -i > /dev/null 2>&1",
|
{ { "xclip -i > /dev/null 2>&1",
|
||||||
"xclip -o < /dev/null 2>/dev/null" } },
|
"xclip -o < /dev/null 2>/dev/null" } },
|
||||||
@ -59,6 +64,12 @@ static clip_command *get_commands()
|
|||||||
if (system("which xclip > /dev/null 2>&1") == 0) {
|
if (system("which xclip > /dev/null 2>&1") == 0) {
|
||||||
return X_CMDS;
|
return X_CMDS;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* xclip and clip.exe may coexist on Windows Subsystem for Linux
|
||||||
|
*/
|
||||||
|
if (system("which clip.exe > /dev/null 2>&1") == 0) {
|
||||||
|
return WINDOWS_CMDS;
|
||||||
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user