From a8b7d89ba55f86b40a10b4be339945f12a948ea8 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Thu, 6 Nov 2025 14:58:11 +0100 Subject: [PATCH] doc terminal-compatibility: document Unicode characters used in output Not sure if this will be useful but the fact that we use very few Unicode characters, suggests that we are insecure about this. Having some kind of central and explicit listing might help future decision-making. Obviously, completions and translations use more characters, but those are not as central. --- doc_src/terminal-compatibility.rst | 10 ++++++++++ share/completions/help.fish | 2 ++ src/common.rs | 9 ++++----- src/exec.rs | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc_src/terminal-compatibility.rst b/doc_src/terminal-compatibility.rst index 2647c98ba..234e5535e 100644 --- a/doc_src/terminal-compatibility.rst +++ b/doc_src/terminal-compatibility.rst @@ -285,3 +285,13 @@ Or add this to your ``config.fish``:: commandline -f repaint functions --erase GNU-screen-workaround end + +Unicode Codepoints +------------------ + +By default, fish outputs the following non-ASCII characters:: + + × ► ¶ ⏎ • ● … μ – ’ ‘ “ ” ← → ↑ ↓ + +as well as control pictures (U+2400 through U+241F), +and locale-specific ones in :ref:`translated strings `. diff --git a/share/completions/help.fish b/share/completions/help.fish index 3a7766e72..a28af0c0f 100644 --- a/share/completions/help.fish +++ b/share/completions/help.fish @@ -378,6 +378,8 @@ function __fish_help_describe -a help_item return case terminal-compatibility#required-commands return + case terminal-compatibility#unicode-codepoints + return case tutorial echo (_ Tutorial) case tutorial#autoloading-functions diff --git a/src/common.rs b/src/common.rs index 2eabd722b..7d4928781 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1032,10 +1032,9 @@ pub fn shell_modes() -> MutexGuard<'static, libc::termios> { crate::reader::SHELL_MODES.lock().unwrap() } -/// The character to use where the text has been truncated. Is an ellipsis on unicode system and a $ -/// on other systems. +/// The character to use where the text has been truncated. pub fn get_ellipsis_char() -> char { - '\u{2026}' + '\u{2026}' // ('…') } /// The character or string to use where text has been truncated (ellipsis if possible, otherwise @@ -1245,7 +1244,7 @@ macro_rules! LL { // neither of \u23CE and \u25CF can be displayed in the default fonts on Windows, though // they can be *encoded* just fine. Use alternative glyphs. OMITTED_NEWLINE_STR.store(LL!("\u{00b6}")); // "pilcrow" - OBFUSCATION_READ_CHAR.store(u32::from('\u{2022}'), Ordering::Relaxed); // "bullet" + OBFUSCATION_READ_CHAR.store(u32::from('\u{2022}'), Ordering::Relaxed); // "bullet" (•) } else if is_console_session() { OMITTED_NEWLINE_STR.store(LL!("^J")); OBFUSCATION_READ_CHAR.store(u32::from('*'), Ordering::Relaxed); @@ -1253,7 +1252,7 @@ macro_rules! LL { OMITTED_NEWLINE_STR.store(LL!("\u{23CE}")); // "return symbol" (⏎) OBFUSCATION_READ_CHAR.store( u32::from( - '\u{25CF}', // "black circle" + '\u{25CF}', // "black circle" (●) ), Ordering::Relaxed, ); diff --git a/src/exec.rs b/src/exec.rs index ee1023d2c..b085c04ed 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -1389,7 +1389,7 @@ fn get_deferred_process(j: &Job) -> Option { } /// Given that we failed to execute process `failed_proc` in job `job`, mark that process and -/// every subsequent process in the pipeline as aborted before launch. +/// every subsequent process in the pipeline as aborted before launch. fn abort_pipeline_from(job: &Job, offset: usize) { for p in job.processes().iter().skip(offset) { p.mark_aborted_before_launch();