Skip to content

Commit

Permalink
add(setup): change the links to be hyperlinks (#768)
Browse files Browse the repository at this point in the history
- change the links in the setup command to be viable hyperlinks
  according to:
  https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
  • Loading branch information
a-kenji authored Oct 25, 2021
1 parent e1dab60 commit a2a0299
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions zellij-utils/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ impl Setup {
.clone()
.or_else(|| config_dir.clone().map(|p| p.join(CONFIG_NAME)));

// according to
// https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
let hyperlink_start = "\u{1b}]8;;";
let hyperlink_mid = "\u{1b}\\";
let hyperlink_end = "\u{1b}]8;;\u{1b}\\\n'";

let mut message = String::new();

message.push_str(&format!("[Version]: {:?}\n", VERSION));
Expand Down Expand Up @@ -310,10 +316,26 @@ impl Setup {
message.push_str(&format!("[ARROW SEPARATOR]: {}\n", ARROW_SEPARATOR));
message.push_str(" Is the [ARROW_SEPARATOR] displayed correctly?\n");
message.push_str(" If not you may want to either start zellij with a compatible mode 'zellij options --simplified-ui'\n");
message.push_str(" Or check the font that is in use:\n https://zellij.dev/documentation/compatibility.html#the-status-bar-fonts-dont-render-correctly\n");
let mut hyperlink_compat = String::new();
hyperlink_compat.push_str(hyperlink_start);
hyperlink_compat.push_str("https://zellij.dev/documentation/compatibility.html#the-status-bar-fonts-dont-render-correctly");
hyperlink_compat.push_str(hyperlink_mid);
hyperlink_compat.push_str("https://zellij.dev/documentation/compatibility.html#the-status-bar-fonts-dont-render-correctly");
hyperlink_compat.push_str(hyperlink_end);
message.push_str(&format!(
" Or check the font that is in use:\n {}\n",
hyperlink_compat
));

message.push_str(&format!("[FEATURES]: {:?}\n", FEATURES));
message.push_str("[DOCUMENTATION]: zellij.dev/documentation/\n");
let mut hyperlink = String::new();
hyperlink.push_str(hyperlink_start);
hyperlink.push_str("https://www.zellij.dev/documentation/");
hyperlink.push_str(hyperlink_mid);
hyperlink.push_str("zellij.dev/documentation");
hyperlink.push_str(hyperlink_end);
message.push_str(&format!("[DOCUMENTATION]: {}", hyperlink));
//printf '\e]8;;http://example.com\e\\This is a link\e]8;;\e\\\n'

std::io::stdout().write_all(message.as_bytes())?;

Expand Down

0 comments on commit a2a0299

Please sign in to comment.