
Show HN: Shox: A customisable status bar for your terminal - liamg
https://github.com/liamg/shox
======
nels
Nice! This seems like a great status bar solution that is independent of which
terminal you use.

For iTerm users, there's a built-in feature that works very well:
[https://www.iterm2.com/documentation-status-
bar.html](https://www.iterm2.com/documentation-status-bar.html)

------
trollied
Both screen and tmux do this, and if you’ve never tried either of them please
do!

Much easier to deal with “tabs” in a single terminal session, plus you can
detach a session and reattach it later. Screen also has a nice feature that
lets you essentially share a terminal session by reattaching it multiple times
without disconnecting the other sessions (screen -x).

~~~
enricozb
Pretty sure you can attach to an already attached tmux session as well, which
I believe has the same behavior that you’re describing. I’ve never used
screen, is what you’re describing different than what I’m talking about?

~~~
furgooswft13
The default behavior of tmux when multiple users are attached to the same
session is that each user shares the same active window. With screen users can
choose the active window independently of others.

You can get similar behavior in tmux by creating a new session with the
"group-name" argument set to that of the name of the session you want to
attach to.

~~~
em-bee
in tmux a window can be in multiple sessions. but tmux also can switch between
sessions easely as switching windows. if you want to connect to the same
session multiple times, you need to either set that up, or you can create and
use multiple sessions to the same effect.

having all windows in a single session synchronized is helpful when you share
sessions with other users.

------
mdszy
Why not just use tmux? Then you get all the features that comes with too.

~~~
danmur
I need a cheat sheet to use tmux. I've no doubt I'd find it valuable if I
spent some time learning it, but I can also appreciate this thing for adding a
nice function without changing the way I work. Not a dig at tmux!

~~~
em-bee
there are plenty of tutorials to get you started, but most importantly you can
run tmux without having learned any of it.

start it and continue working as if it wasn't there. then read or learn one
thing or two about it, and use only that.

the first thing to learn is how to attach to an existing session. that alone
can be useful.

if you scroll a lot on your terminals, you'll want to learn scrolling in tmux.

if you use tabs or multiple windows, you' want to learn how create and switch
windows in tmux.

beyond that every feature in tmux is additional to your regular terminal use
so you can pick and choose the features you want to learn as you go along and
otherwise continue without changing the way you work.

i have used tmux for a decade and i am still learning new stuff, like how to
effectively use split windows.

------
t0astbread
I only had a quick glance at the source code and my Go is terrible so forgive
me if I've misunderstood something.

But am I right in the assumption that this includes a proxy that acts as a
sort of "middleware" layer for the terminal without explicit support from
either the shell or the terminal?

If so, this might have a lot more potential than it seems. Imagine how much
you could do with "terminal middleware"!

~~~
ohithereyou
Terminal middleware already exists - screen and tmux seem to be the most
popular here.

~~~
t0astbread
Tmux could be seen as an example of "terminal middleware" but I mean a more
general solution.

Imagine you had a framework that lets you write scripts to intercept and
modify I/O from programs running in a shell. You could have password managers
that automatically (or semi-automatically) answer sudo prompts. Or filters
that censor certain strings (if you're live streaming coding sessions this
could be very useful) before they appear on screen.

Another useful "terminal middleware" layer could be pre-processing commands
before (or after) the shell parses them. You could wrap every command in a
`script -c` invocation in order to capture the output so that you can later
re-use it without having to redo the processing. (This is probably my biggest
pet peeve with Un*x since it really adds up over time.)

~~~
chaorace
There's a spectrum of these. There's terminals that have their own modes, like
Termite. There's also terminals that have their own scripting/extension
frameworks, like hyper.js or secureCRT.

My personal favorite is Emacs. It's the only environment I've ever been able
to rig up that's truly, fully hackable. Since terminal output is treated like
any other text buffer, I can roll just about any package I like on top without
issue.

In particular, this solved my ssh woes. There's no need to reconfigure my
terminal dozens of times each day, because all my preferences and tweaks exist
on a higher layer.

------
thrownaway954
again... again... I have to be the jerk here.

why is there nothing that shows what this does on the project page? You've
spent countless hours creating this thing, yet you can't spend 10 more minutes
showing off the capabilities?

you have a static PNG image that is confusing at best. create a 15 second
animated GIF that shows off your work.

~~~
Lammy
I thought the static PNG was just fine, personally. What would an animated GIF
show here, the time changing every 60 seconds? Animated product showcases are
just annoying to me because I can't study any particular scene long enough to
see everything.

~~~
thrownaway954
how about a GIF of editting the config file and showing how the terminal
status bar changes when reload the terminal.

~~~
kingosticks
You could... but it's really not necessary after a quick glance at the still
image and the brief instruction text. I think this is fine as it is.

------
ngz00
Hey, any chance I could look at your Dotfiles? I like that terminal setup.

------
slightwinder
So this puts some basic information into every terminal, and there is no way
add your own information? Why not use the normal Bar from your windowmanager
or desktop environment?

I could understand it if you can personalize the bars per terminal, and show
some context-specific informations. Stuff like git-branch, hostname, docker-
container or active virtual environment, which usually ends in the prompt and
is more of a waste to be located there. But there seems to be no way for
scripting this?

------
flippyhead
Neat! I rarely mess with my prompt but actually now that I've seen this seeing
things like CPU especially in a development context could be quite useful.

Also, it would be great to see more examples.

------
rcarmo
Nice. I have almost exactly the same indicators on my tmux configuration. A
bit curious as to how this plays along with mc and vim, will try it.

------
retpirato
would this work on chrome OS's implementation of Linux & if so would it be
easy to disable/uninstall?

------
pizza
Reminds me of byobu + tmux, looks cool

------
sneak
Do not pipe random scripts from the internet into

    
    
        | sudo bash

~~~
t0astbread
This can be generalized into "do not install random programs from the internet
onto your machine".

Familiarize yourself with the program, the author and the supply chain, then
you can also `curl | bash` safely.

~~~
useragent86
No, it has been demonstrated that servers can detect whether a request is
being downloaded or piped to a shell, so they can vary the response
accordingly, sending safe-looking content to a user who's inspecting it, and
sending malicious content to a shell.

[https://www.idontplaydarts.com/2016/04/detecting-curl-
pipe-b...](https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-bash-
server-side/)

`curl | sh` is a terrible anti-pattern. It should _never_ be encouraged.

~~~
em-bee
familiarizing yourself with the program, the author and the supply chain is
more than just inspecting the downloaded code.

