Piping terminal output to the browser using systemfd

이 글은 systemfd와 watchexec를 활용해 컴파일 중인 백엔드 서버의 터미널 출력을 웹 브라우저에 실시간 스트리밍하는 방법을 소개합니다. Rust 프로젝트 예시를 중심으로, 열린 소켓을 유지해 클라이언트 연결을 끊지 않고 컴파일 로그를 HTML과 xterm.js 기반 터미널로 보여줍니다. socat을 이용해 열린 소켓에 로그를 전달하고, 자바스크립트로 스트림을 받아 재연결과 컬러 출력도 지원합니다. 이 기법은 Rust뿐 아니라 listenfd 유사 라이브러리가 있는 모든 컴파일 언어에 적용 가능해 개발 피드백 루프를 크게 단축시킵니다.

https://blog.izissise.net/posts/webdev-livecompile/

#systemfd #watchexec #rust #socat #xtermjs

Piping terminal output to the browser using systemfd

Oh how I wish  #Inkscape had an automatic also-save-as-PDF-on-save functionality...

inkscape -o myfile.{pdf,svg}

is nice and short, and you can easily #watchexec that, but it'd be so great if it could just auto-save a PDF version next to the SVG on save.

Just came back to #watchexec crate.

A #rust module to watch and react to kernel events 👀
- file changes
- key press
- ...

The documentation is still tricky and outdated because of the rapidly evolving project!

But there is an undeniable effort to simplify and get stuffs together to the point that the code, comments and test files are astonishingly understandable and copy-pastable!

Skim through the doc to grasp the project structure then just dive into the code.

https://github.com/watchexec/watchexec/tree/main/crates/lib

watchexec/crates/lib at main · watchexec/watchexec

Executes commands in response to file modifications - watchexec/watchexec

GitHub
More #Rust #CLI #tools:
#navi ⬅️ man+fzf
#hyperfine ⬅️ benchmarking
#czkawka ⬅️ duplicates finder
#mdcat ⬅️ markdown render
#tectonic ⬅️ latex engine
#grex ⬅️ RE generator
#watchexec ⬅️ run commands on file modifications
#xh ⬅️ httpie
#just ⬅️ command runner
#tokei ⬅️ cloc
#sd ⬅️ sed
#amber ⬅️ sed
#dua ⬅️ ncdu
#pueue ⬅️ parallel
Trois utilitaires : Delta, Dust et Watchexec - LinuxFr.org

L’actualité du logiciel libre et des sujets voisins (DIY, Open Hardware, Open Data, les Communs, etc.), sur un site francophone contributif géré par une équipe bénévole par et pour des libristes enthousiastes

Trois utilitaires : Delta, Dust et Watchexec - LinuxFr.org

L’actualité du logiciel libre et des sujets voisins (DIY, Open Hardware, Open Data, les Communs, etc.), sur un site francophone contributif géré par une équipe bénévole par et pour des libristes enthousiastes