add paste function

This commit is contained in:
Cai BingJun 2023-02-03 15:35:47 +08:00
parent b31d10d094
commit b33365ed8e
3 changed files with 8 additions and 19 deletions

View file

@ -38,26 +38,10 @@ pub struct StdinReader {
}
impl StdinReader {
#[cfg(all(target_os = "linux", feature = "full-repl"))]
fn access_clipboard() -> Option<Output> {
Command::new("inclip")
.output()
.ok()
}
#[cfg(all(target_os = "macos", feature = "full-repl"))]
#[cfg(feature = "full-repl")]
fn access_clipboard() -> Option<Output> {
Some(
Command::new("pbpast")
.output()
.expect("failed to get clipboard"),
)
}
#[cfg(all(target_os = "windows", feature = "full-repl"))]
fn access_clipboard() -> Option<Output> {
Some(
Command::new("powershell")
.args(["get-clipboard"])
Command::new("inclip")
.output()
.expect("failed to get clipboard"),
)