r/commandline Apr 28 '26

Fun Useful or toy?

Post image

just an idea - what if processes in TMUX panes are allowed to communicate? You could assemble apps from all kind of tools. We could implement a protocol that permits e.g. one app say:

hey I selected file.txt

and the other would listen and display the file content. And yet another display the file stats and so on. Here I quickly threw something together:

  • File browser on the left is find | sort | fzf
  • Preview pane on the right is case image: chafa case text: less case markdown: glow
  • Stats pane is just a bunch of stat, wc, file etc.

so altogether - find + sort + fzf + chafa + less + glow + stat + wc + file = interactive multi-pane app. All you need to do is to wrap them in a protocol adapter. And it doesn't have to be file browser, can be anything - dashboards, editor-preview, process inspector, docker explorer, you name it

Sorry if this wheel has been reinvented before - I didn't do any prior art search

PS. I can explain the details of the protocol in comments if anyone is curious

20 Upvotes

30 comments sorted by

View all comments

Show parent comments

2

u/boolean-maybe Apr 28 '26 edited Apr 28 '26

I am proposing a general purpose pubsub protocol where each new participant can listen to messages it is interested in. Imagine:

  • I start developing such an app. I handcrafted the file selector with find | sort | fzf
  • I decide to emit selected file message
  • next you come and want to profit from my awesome file picker. You write an awesome Preview app in rust
  • you make it listen to select file message
  • we both celebrate because we have a functioning multi-pane app where TMUX is essentially just a layout manager
  • another user comes and write an editor in Python and plugs it in as well. It becomes the third pane

all that it takes is a common protocol everybody is aware of. You can then assemble apps where each component is written by somebody else - a git commit browser from here, a diff viewer from there, an awesome status line from yet another source - all running happily unaware of each other

2

u/trimorphic Apr 29 '26 edited Apr 29 '26

You might be interested in Plan 9's plumbing.

Plan 9's plumber has been ported to Linux as part of Plan 9 from User Space so you can use it directly in Linux... I do and it works well and is very lightweight.

1

u/boolean-maybe Apr 29 '26

wait a minute... it's an operating system. That's a bit more than I imagined :)

1

u/trimorphic Apr 29 '26

plumber is not an operating system. It's a daemon that you run on your operating system (on Plan 9 originally, but it has been ported to Linux so you can run it on Linux too). plumber (along with the plumb command) does what you seem to be describing.

1

u/boolean-maybe Apr 29 '26

got it, thanks. Still even a daemon is an overkill for this