mirror of
https://github.com/wez/wezterm.git
synced 2024-11-10 15:04:32 +03:00
use the open
crate for url clicking
This commit is contained in:
parent
3812ec55b1
commit
4c39faffbe
@ -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
get-deps
1
get-deps
@ -28,6 +28,7 @@ case `lsb_release -ds` in
|
||||
libfreetype6-dev \
|
||||
libegl1-mesa-dev \
|
||||
libharfbuzz-dev \
|
||||
xdg-utils \
|
||||
ragel
|
||||
;;
|
||||
*)
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user