Skip to content
Snippets Groups Projects
Unverified Commit 49fba94a authored by Michael Aaron Murphy's avatar Michael Aaron Murphy Committed by GitHub
Browse files

Merge pull request #647 from jackpot51/master

Add title bar setting, add ability to produce any character using hex code
parents 5cd60d8e 00d72175
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ impl Default for Variables { ...@@ -34,7 +34,7 @@ impl Default for Variables {
map.insert("HISTFILE_SIZE".into(), "1000".into()); map.insert("HISTFILE_SIZE".into(), "1000".into());
map.insert( map.insert(
"PROMPT".into(), "PROMPT".into(),
"${c::0x55,bold}${USER}${c::default}:${c::0x4B}${SWD}${c::default}# ${c::reset}".into(), "${x::1B}]0;${USER}: ${PWD}${x::07}${c::0x55,bold}${USER}${c::default}:${c::0x4B}${SWD}${c::default}# ${c::reset}".into(),
); );
// Set the PID variable to the PID of the shell // Set the PID variable to the PID of the shell
let pid = getpid() let pid = getpid()
...@@ -223,6 +223,15 @@ impl Variables { ...@@ -223,6 +223,15 @@ impl Variables {
// designated. Find it. // designated. Find it.
match name { match name {
"c" | "color" => Colors::collect(variable).into_string(), "c" | "color" => Colors::collect(variable).into_string(),
"x" | "hex" => match u8::from_str_radix(variable, 16) {
Ok(c) => {
Some((c as char).to_string())
},
Err(why) => {
eprintln!("ion: hex parse error: {}: {}", variable, why);
None
}
},
"env" => env::var(variable).map(Into::into).ok(), "env" => env::var(variable).map(Into::into).ok(),
_ => { _ => {
if is_root() { if is_root() {
...@@ -246,7 +255,7 @@ impl Variables { ...@@ -246,7 +255,7 @@ impl Variables {
match namespace.execute(variable.into()) { match namespace.execute(variable.into()) {
Ok(value) => value.map(Into::into), Ok(value) => value.map(Into::into),
Err(why) => { Err(why) => {
eprintln!("ion: string namespace erorr: {}: {}", name, why); eprintln!("ion: string namespace error: {}: {}", name, why);
None None
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment