HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
ku1ik
stderred
C2011–2023
ku1ik / stderred

stderred

stderr in red

12Distinct people
13Mentions
1Explicit recommenders
1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

stderr in red

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

Less 'script', but things that make my terminal experience better more generally: 1. Adding a colorful 'bullet point' to my prompt, to visually differentiate it clearly from…

tpoacher used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year13 dated mentions

Observed mentions: 2011-12-13 22:07:02 UTC to 2023-08-14 19:20:08 UTC.

012342011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 4 mentions; 1 submissions, 3 comments20112012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC413
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC000
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC000
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC211
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC303
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC110
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

What Hacker News says

13 sources
tpoacher·Aug 14, 2023Recommendation phrase
Less 'script', but things that make my terminal experience better more generally: 1. Adding a colorful 'bullet point' to my prompt, to visually differentiate it clearly from other (possibly also coloured) lines: export PS1="\[\033[32m\]▶\[\033[39m\] $PS1" 2. Installing all of my custom scripts as 'programs' (complete with a bin directory, for easy inclusion in my PATH) under /opt/my for better tracking/management, as opposed to e.g. /usr/local/bin 3. A 'checkupdates' alias which performs update-checks via multiple systems (in my case: apt, flatpak, and my totally awesome misc-updater - see here if interested: https://sr.ht/~tpapastylianou/misc-updater/) 4. libstderred (https://github.com/ku1ik/stderred) 5. The following exports (I'll let you decipher them) export LESS="-I -R -S -j.5 -#2" export PYTHONDONTWRITEBYTECODE="AnythingHere
Read the rest
ToSetAsTrue" # For man-page colorization (also affects things like python help pages) export LESS_TERMCAP_mb="$(printf "\e[1;31m")" export LESS_TERMCAP_md="$(printf "\e[1;31m")" export LESS_TERMCAP_me="$(printf "\e[0m")" export LESS_TERMCAP_se="$(printf "\e[0m")" export LESS_TERMCAP_so="$(printf "\e[1;44;33m")" export LESS_TERMCAP_ue="$(printf "\e[0m")" export LESS_TERMCAP_us="$(printf "\e[1;32m")" And now script things (assume omitted shebangs where appropriate): 1. "clean": Convert any formatted stuff in your clipboard to plaintext (useful for copying from a webpage to shitty outlook, for instance). xsel -ob | xsel -ib 2. "gless": (see https://sr.ht/~tpapastylianou/gless). Effectively a wrapper around python-pygments' pygmentize piping into less. pygmentize -g -O style=fruity "$@" | less -R 3. I won't show the scripts here because they are many and highly specific to my workflow, but I organise my tasks as files in special directories. Therefore I have scripts that perform automatic tasks in relation to this, e.g. "addtoday", "markasdone", "move to today/month/projects/ongoing/waiting" etc. Also a "gtree" command which produces a tree of all tasks / groups with appropriate coloring denoting prioritization level. Works great for me. If anyone's interested I can try to create a package and share further. 4. "gotodir": Go to the file path saved in your clipboard. Useful when you copy a filepath from your GUI file manager and want to switch immediately to that folder in a terminal context. Needs to be sourced (i.e. `. gotodir`). Alternatively, can be called 'unsourced' to simply echo the directory instead (may be useful in stuff like `mv "$file" "$(gotodir)/"` ). DIR="$(xsel -ob)" if test -d "$DIR"; then cd "$DIR"; echo "$DIR"; fi 5. "lastfile": echo the last (in terms of sorting order) file on a directory. Useful when dealing with files that are naturally sorted, like, e.g. dated entries of logs (e.g. "2023-01-01 Meeting Minutes"). Then something like `nano $(lastfile)` will open the latest meeting notes. ls -1 --color=none | tail -n -1 6. "log": A simple wrapper to opening, e.g., nano on a specific file that you use as your diary, to log a new entry. nano "/path/to/my/personal/diary.md" 7. "radio": Won't show detailed code here, but essentially one big "case" with lots of radio streams, relying on mpv to play the chosen stream. Accompanied by a .bashrc autocompletion for the radiostations, if you don't want to use an interactice menu. 8. "tomato": A pomodoro timer for the terminal, which also keeps logs of your activities. See https://sr.ht/~tpapastylianou/tomato/
In Ask HN: Share a shell script you like
I treated myself a deep dive into how CLIs work some time ago and features like: * marking output from stderr different color (and don't interfere with commands's own formatting much); * passing more involved keyboard shortcuts to the shell or a tui program, etc.; * making last line of last command usable in next command or putting it to clipboard without mouse; * general awareness of shell/terminal emulator of what's displayed (prompt, edited line, commands printing in parallel, stdout vs stderr, messages of shell (jobs)) are very tricky to achieve without reorganizing the whole stack of terminal emulator, shell, line discipline/readline and even kernel. [0] http://www.linusakesson.net/programming/tty/index.php [1] https://utcc.utoronto.ca/~cks/space/blog/unix/TTYLineDiscipl... [2] https://github.com/sickill/stderred [3] http://www.leone
Read the rest
In Colorize Your CLI
I came across stderred a few months ago while looking to do the same thing on my terminals. I ultimately didn't go with it because people have reported destroying their systems while using it[1]. Wrapping libc (which is itself wrapping the actual syscall) is a tricky thing to do safely. I looked into accomplishing the same thing with URxvt's pre- and post-text rendering hooks, but couldn't get it to work. [1]: https://github.com/sickill/stderred/issues/63
In Colorizing Stderr: racing pipes, and libc monkey-patching
The reason would be interleaving if more than one process is writing to stderr. I was more bothered by the use of alloca(). Even on a 32-bit system with a 32-bit size_t, you can blow your stack to hell with a single call to this modified write(). Having to do a full malloc() here would be pretty lame, but as others suggested, writev() should do nicely. The other nice property of using writev() is that you don't have to bother with the dlopen/dlsym crap. Can just call writev() directly from the overridden write() in either case. Of course, that doesn't catch people writing to stderr using writev() directly, but I think that's ok. (The current impl doesn't catch that case anyway.) (edit: pull request submitted! https://github.com/sickill/stderred/pull/6)
In Make your STDERR red

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.