Fix log-pane for rust-based core-utils#14
Open
pantaray wants to merge 2 commits into
Open
Conversation
Buffering via stdbuf only works with C code using stdio; modern Ubuntu (25.10+) uses a re-write of the core-utils in rust, which stdbuf has no effect on. Updated the log-pane setup to instead rely solely on awk and its built-in fflush() function
giordano
reviewed
Jun 24, 2026
Comment on lines
+47
to
+50
| tail -f '${LOG_FILE}' | \ | ||
| stdbuf -o 0 nl -s'%' -n'ln' -w1 | \ | ||
| stdbuf -o0 grep -v '%#' | \ | ||
| awk -F'%' '{print \"\033${CYAN}\"\$1\"\033[0m\",\$2}'" |
Member
There was a problem hiding this comment.
Can you keep the comments that were in the previous code? Explaining also what's going on in the code above would nice, too.
On branch master Changes to be committed: modified: swc-shell-split-window.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of all, thank you for this amazing tool! We've relied on it for teaching and people absolutely love it! The history pane on top is super useful for learners - and helpful for instructors too (in case you lost your train of thought)!
Prepping for our upcoming workshop, we've noticed that the history pane on top was created correctly but did not show anything. Turns out this seems to be a buffering issue on modern Ubuntu (25.10+) systems, that migrated GNU
coreutilsto Rust-based uutils/coreutils. That renders buffer-control viastdbufineffective for the rust-basednl, so that adding line numbers to the history remains buffered and nothing shows up in the top pane.We've updated the respective
tmux new-session -d -s "${SESSION}" ...line to instead rely solely onawkand its built-infflush()function. To preserve backwards compatibility, the existingstdbuf-based command is still there and used if the installed version ofawkdoes not supportfflush()(may be the case for some very old macOS/Linux machines).Thanks again for this super helpful tool!