use the open crate for url clicking

This commit is contained in:
Wez Furlong committed 2019-02-18 22:57:40 -08:00
1 parent 3812ec55b1
commit 4c39faffbe
5 files changed
+8 -11

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ rusttype = "0.7"
clipboard = "0.5"
unicode-normalization = "~0.1"
freetype = "~0.4"
open = "1.2"
[target.'cfg(unix)'.dependencies]
harfbuzz-sys = "~0.2"
+1
View File
@@ -28,6 +28,7 @@ case `lsb_release -ds` in
libfreetype6-dev \
libegl1-mesa-dev \
libharfbuzz-dev \
xdg-utils \
ragel
;;
*)
+3 -6
View File
@@ -1,7 +1,7 @@
//! Generic system dependent windows via glium+glutin
use super::Child;
use super::MasterPty;
use super::{Child, Command};
use clipboard::{ClipboardContext, ClipboardProvider};
use config::Config;
use failure::Error;
@@ -67,12 +67,9 @@ impl term::TerminalHost for Host {
&mut self.pty
}
fn click_link(&mut self, link: &Rc<Hyperlink>) {
// TODO: make this configurable
let mut cmd = Command::new("xdg-open");
cmd.arg(link.uri());
match cmd.spawn() {
match open::that(link.uri()) {
Ok(_) => {}
Err(err) => eprintln!("failed to spawn xdg-open {}: {:?}", link.uri(), err),
Err(err) => eprintln!("failed to open {}: {:?}", link.uri(), err),
}
}
+1
View File
@@ -27,6 +27,7 @@ extern crate serde;
extern crate serde_derive;
extern crate clipboard;
extern crate font_loader;
extern crate open;
extern crate rusttype;
extern crate term;
extern crate termwiz;
+2 -5
View File
@@ -121,12 +121,9 @@ impl<'a> term::TerminalHost for TabHost<'a> {
}
fn click_link(&mut self, link: &Rc<Hyperlink>) {
// TODO: make this configurable
let mut cmd = Command::new("xdg-open");
cmd.arg(&link.uri());
match cmd.spawn() {
match open::that(link.uri()) {
Ok(_) => {}
Err(err) => eprintln!("failed to spawn xdg-open {}: {:?}", link.uri(), err),
Err(err) => eprintln!("failed to open {}: {:?}", link.uri(), err),
}
}