News for hackers. Stuff that matters.
Re:St – A simple terminal implementation for X by mikejmoffitt on Wednesday February 01, 2017 @11:04PM (#13548019)
I like the principles behind its design, but not supporting scrollback and saying "that functionality should be provided by tmux or something similar" is baffling when it's done in the name of removing bloat and complexity.

Not everybody wishes to use a terminal multiplexer in all cases, either.

Re:St – A simple terminal implementation for X by ycmbntrthrwaway on Wednesday February 01, 2017 @11:30PM (#13548122)
Scrollback is implemented as a patch: http://st.suckless.org/patches/scrollback
Re:St – A simple terminal implementation for X by aexaey on Thursday February 02, 2017 @03:56AM (#13549107)
This.

Also, one should keep in mind that having to apply personal patches is perfectly acceptable for suckless software. In fact, for the very same st, to change font, colour scheme, or hotkeys/shortcuts - one has to edit config.h file and recompile. There is no traditional text config file or "Preferences" menu.

This might sound bizarre at first, but actually works as well as editing a text config file: config.h is very well structured and compilation only takes fraction of a second. Better yet, you're not constrained by opinions of previous commiters on what should be configurable and what - not. Which is the whole point, actually.

Re:St – A simple terminal implementation for X by vog on Thursday February 02, 2017 @08:06AM (#13550217)
> Also, one should keep in mind that having to apply personal patches is perfectly acceptable for suckless software.

I don't get it. This patch increases the code base by merely 60 lines of code (104 insertions, 44 deletions).

Is 60 lines already considered bloat, in a verbose language like C?

Also, is this meant to lead to fewer complexity? Maintaining the patch separately from the code base is nothing but cumbersome. Essentially this is a long-time feature branch, which is a well-known anti-pattern regarding software quality and maintenance. What if there are more and more of such patches? What if they overlap and can't be applied together? In a central code base these formal conflicts would be resolved once and for everyone, early on.

I would have expected this feature (and its code) to be enabled/disabled by a single #define in config.h. That would be more consistent with the suckless philosophy of configuration. Or, reducing that bloat by simply enabling it always.

Re:St – A simple terminal implementation for X by juliangoldsmith on Thursday February 02, 2017 @09:35AM (#13550744)
>Is 60 lines already considered bloat, in a verbose language like C?

It's more about features. tmux and screen are widely used, so a lot of people won't need that functionality to be duplicated. Keeping extra features separate lets the users pick and choose what they want.

It's also worth noting that suckless's software is not meant for someone who wants a turnkey solution. It's meant to be customized by most every user.

Re:St – A simple terminal implementation for X by ycmbntrthrwaway on Thursday February 02, 2017 @05:41PM (#13555623)
> Is 60 lines already considered bloat, in a verbose language like C?

Due to high code quality, removing even 10 lines is an achievement for suckless.org projects. Try it yourself and submit a patch to mailing list if you succeed.

> Also, is this meant to lead to fewer complexity? Maintaining the patch separately from the code base is nothing but cumbersome.

Maintaining feature as a patch prevents you from weaving it deep inside the code, adding hooks here and there just to make it work. It is harder to do, but it is the right way to make sure all feature related logic is kept in one place.

I have some pet suckless inspired projects. During development I introduced some useless features such as pthread support just because I learned about them. Then once I realized they are useless I removed them. It greatly improved code structure.

Re:St – A simple terminal implementation for X by vog on Monday February 06, 2017 @10:49AM (#13580493)
> Maintaining feature as a patch prevents you from weaving it deep inside the code, adding hooks here and there just to make it work. It is harder to do, but it is the right way to make sure all feature related logic is kept in one place.

I'm used to achieve this by keeping each topic in a separate module (in C: function or file, in other languages: module, class, whatever). You'd then have clear entry points into that module.

Interestingly, the given patch isn't structured like that. So I'd argue that code would benefit from becoming a first-class citizen in the code base. As a patch it just gives the illusion of a well-separated feature. (Because a patch file is always a single file, no matter how much the changes are scattered around in the code base.)

> I have some pet suckless inspired projects. During development I introduced some useless features such as pthread support just because I learned about them. Then once I realized they are useless I removed them. It greatly improved code structure.

I fully agree that removing useless features does not only shorten, but simplify code. However, given that by far not everybody uses screen/tmux, I disagree with the "scrolling is useless" assumption here.

Re:St – A simple terminal implementation for X by floatboth on Thursday February 02, 2017 @08:13AM (#13550252)
> to change font, colour scheme, or hotkeys/shortcuts

No, you don't have to recompile it. For shortcuts, sure, but I haven't used any st shortcuts besides font size +/-.

Colors can be changed via the shell e.g. https://github.com/chriskempson/base16-shell and the font is passed via the -f flag.

Re:St – A simple terminal implementation for X by hobarrera on Thursday February 02, 2017 @08:04AM (#13550210)
What I dislike about this, is that I have to manually track new versions -- rather than just have my package manager pull in new versions that read a `st.conf` file.
Re:St – A simple terminal implementation for X by bratch on Thursday February 02, 2017 @01:55PM (#13553338)
Gentoo's package manager (Portage) deals with this quite nicely for packages like st [1].

Both custom patches and config.h changes can be saved in the package manager, which will then apply them automatically to new versions.

[1] https://packages.gentoo.org/packages/x11-terms/st

Re:St – A simple terminal implementation for X by dhimes on Thursday February 02, 2017 @08:13AM (#13550251)
Also, I like different colors for different things. Production server terminals look different that staging server terminals that look different than development terminals.
Re:St – A simple terminal implementation for X by aexaey on Thursday February 02, 2017 @08:26AM (#13550314)
As floatboth pointed out above, it is possible to use a shell script [1] to dynamically change terminal colour mapping. Add this as "LocalCommand" to appropriate "Host staging-foo" and "Host production-bar" sections of the ~/.ssh/config file, and you're all set.

[1] https://github.com/chriskempson/base16-shell

Re:St – A simple terminal implementation for X by nightcracker on Thursday February 02, 2017 @04:04AM (#13549141)
It is still bizarre because not every user wants to and/or doesn't have the skills to do that.
Re:St – A simple terminal implementation for X by icebraining on Thursday February 02, 2017 @04:24AM (#13549216)
What lisaberlin wrote applies - suckless is like Unix: user friendly, just very selective about who it decides to make friends with.

But in this case, I would disagree. The file is quite readable (way more than most text config files I've seen), and the single command to compile is even included in the README. If you're the kind of person that purposefully downloads a new terminal, rather than using the built-in one, you can probably configure st just fine.

Re:St – A simple terminal implementation for X by woah on Thursday February 02, 2017 @07:18AM (#13549999)
Seems like kind of a pretentious choice... they've structured their program so the config file is a .h file just so you can feel cool when you compile it to change font size?
Re:St – A simple terminal implementation for X by wtetzner on Thursday February 02, 2017 @07:35AM (#13550070)
I suspect it's not so you feel cool, but because it means the program doesn't need a parser for config files, and because it's more flexible.
Re:St – A simple terminal implementation for X by contras1970 on Thursday February 02, 2017 @09:35AM (#13550741)
parserless configuration is easily achieved with stuff like envdir: https://cr.yp.to/daemontools/envdir.html
Re:St – A simple terminal implementation for X by juliangoldsmith on Thursday February 02, 2017 @09:40AM (#13550779)
That just parses environment variables, instead of files.
Re:St – A simple terminal implementation for X by wtetzner on Monday February 13, 2017 @12:36PM (#13637082)
Not to mention that it's yet another dependency, which is another thing that's avoided by doing configuration through a header file.
Re:St – A simple terminal implementation for X by dubberx on Sunday February 05, 2017 @06:10AM (#13571848)
> suckless is like Unix: user friendly, just very selective about who it decides to make friends with

I like to use the term "super-user friendly", as a compliment.

Re:St – A simple terminal implementation for X by lisaberlin on Thursday February 02, 2017 @04:12AM (#13549167)
Yes, and that's perfectly ok. These people simply aren't the target audience, just like you wouldn't recommend Arch to a Linux beginner.
Re:St – A simple terminal implementation for X by boomboomsubban on Thursday February 02, 2017 @05:00AM (#13549390)
Not having the skills isn't the thing that should stop someone in either scenario, it's not wanting the skills. Arch is great for a beginner that wants to know how to set up their own bootloader and similar things, you can use Ubuntu for years without gaining that knowledge. Or how much C editing and compiling does the average Unix user happen to run into?

There's very little natural progression in computer use, people do things the way they know how until they decide to learn more. Think of how many time's you've seen some family member slowly select file-save without ever figuring out ctrl-s.

Re:St – A simple terminal implementation for X by Ziomislaw on Thursday February 02, 2017 @06:05AM (#13549656)
if you don't like it than fork it
Re:St – A simple terminal implementation for X by boomboomsubban on Thursday February 02, 2017 @06:42AM (#13549814)
I find in hard to fork human behavior and have anything one might consider a good adoption rate.
Re:St – A simple terminal implementation for X by sametmax on Thursday February 02, 2017 @04:25AM (#13549221)
Exactly. I would never use it, but I'm perfectly alright having something targeting a niche perfectly. It's better than trying to please everybody and ending up being "meh".
Re:St – A simple terminal implementation for X by eru on Thursday February 02, 2017 @05:31AM (#13549508)
Agreed in general. (As a small counterpoint: I helped a beginner get familiar with Linux. We tried Ubuntu first, and she hated it. She switched to Arch and has been happy ever since.)
Re:St – A simple terminal implementation for X by loup-vaillant on Thursday February 02, 2017 @06:03AM (#13549648)
The Xmonad window manager is configured by editing its source code as well, and believe me, you don't have to know Haskell to do it. They pushed the DSL approach to a point where the main function reads like a configuration file, whose format can be learned just by looking at it.
Re:St – A simple terminal implementation for X by dedsm on Thursday February 02, 2017 @07:37AM (#13550082)
this is not entirely true, xmonad's config file happens to be a haskell file, but I don't need to recompile the whole xmonad project if I want to change it, I just start xmonad again.

It does some tricks to do this (mainly the _main_ xmonad executable compiles a custom binary for you taking the xmonad.hs as input), but it's a different case.

http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Doc-Conf...

Re:St – A simple terminal implementation for X by sevensor on Thursday February 02, 2017 @10:08AM (#13550980)
If this experience has been improved, I might try xmonad again. I used it for 2.5 years but switched to i3 in 2013 after finding myself in cabal hell for the umpteenth time. Recompiling GHC to make my window manager work was not my idea of a good time.
Re:St – A simple terminal implementation for X by pmoriarty on Thursday February 02, 2017 @11:08AM (#13551531)
I switched from xmonad to another window manager and eventually to i3 many years ago, and there's no way I'm going back.

Yes, you can do simple stuff in xmonad without knowing Haskell. But for more complicated stuff, you have to either copy and paste code that you don't understand, or ask someone who knows Haskell to write it for you. And there's no way you're going to be able to do troubleshoot non-obvious problems without either knowing Haskell or once again asking someone who knows Haskell to do it for you. That's way too much of a pain in the ass.

Configuring and troubleshooting i3 doesn't require knowing Haskell, is really simple, flexible enough for what I need, and any advanced functionality I want it to perform I can program in my own language of choice.

Re:St – A simple terminal implementation for X by jsjohnst on Wednesday February 01, 2017 @11:23PM (#13548096)
I can't believe they added serial line support and not scrollback. If you're going to claim bloat, serial line support definitely ranks lower on priority than scrollback.
Re:St – A simple terminal implementation for X by nine_k on Thursday February 02, 2017 @01:19AM (#13548537)
Likely they enjoy tinkering with hardware, so they just needed the serial line support themselves.
Re:St – A simple terminal implementation for X by josteink on Thursday February 02, 2017 @04:38AM (#13549296)
With serial support, you definitely want scrollback, since you can't run GNU screen (or tmux for the hipsters) during a HW bootsequence.

It absolutely seems like very conflicting decisions user-experience wise.

Re:St – A simple terminal implementation for X by jstimpfle on Thursday February 02, 2017 @05:39AM (#13549547)
What reasons are there not to use tmux over screen these days?
Re:St – A simple terminal implementation for X by josteink on Thursday February 02, 2017 @05:47AM (#13549590)
Plenty of reasons: Habits. Existing scripts. Muscle-memory. GNU/GPL over non-GNU/GPL. To mention a few.

I've honestly not found a single feature in tmux which I need which isn't already covered (and imprinted in finger-memory) by GNU screen.

On the flip side, I'd ask: What reason is there for a seasoned GNU screen user to bother switching from something proven, and which works?

Re:St – A simple terminal implementation for X by jstimpfle on Thursday February 02, 2017 @06:07AM (#13549665)
These reasons are valid, but I'm more interested in technical reasons.

I switched to tmux when I needed to launch a lot of simultaneous jobs, categorized in three sessions (starting in "active", moving to "success" or "fail" when finished). I couldn't achieve it in screen at the time. The CLI interface of tmux is not very intuitive and I think somewhat inconsistent (maybe a bit like git?), but at least I could achieve what I wanted without major compromises.

After a quick google search my impression is that running a shell command in a particular GNU screen window is still painful.

Re:St – A simple terminal implementation for X by josteink on Thursday February 02, 2017 @07:22AM (#13550022)
> These reasons are valid, but I'm more interested in technical reasons.

Sure. And let's go full circle while we're at it: GNU screen supports connecting directly to a serial device :)

Last I checked tmux doesn't.

Re:St – A simple terminal implementation for X by jsjohnst on Thursday February 02, 2017 @08:48AM (#13550427)
Other reasons have been listed already, but if you're an iTerm2 user, another strong reason to use tmux over screen is the fact tmux can use "native windows" in macOS and you have deep integrations between the two. It's especially useful with remote tmux sessions.
Re:St – A simple terminal implementation for X by cuckcuckspruce on Thursday February 02, 2017 @11:43AM (#13551912)
You can absolutely run GNU screen during a HW boot sequence through serial. See the Windows Types[1] section of the GNU screen manual.

[1] https://www.gnu.org/software/screen/manual/html_node/Window-...

Re:St – A simple terminal implementation for X by swinglock on Thursday February 02, 2017 @11:57AM (#13552033)
But if you're going to use screen to connect to your serial port, what was the point in adding serial to support to the terminal emulator?

To make the argument that scrollback is bloat is insane if you at the same time add serial support but need scrollback for serial usage, so you use screen instead which had both serial support and scrollback.

Re:St – A simple terminal implementation for X by jsjohnst on Thursday February 02, 2017 @08:42AM (#13550399)
Can you describe the scenario where you can't use screen but can use a terminal emulator with serial support? I've done a ton of work using serial (mostly routers and switches, but some other stuff too) and never found an instance where that didn't work.
Re:St – A simple terminal implementation for X by jsjohnst on Thursday February 02, 2017 @08:44AM (#13550406)
So why isn't screen or minicom a valid reason to "avoid bloat" in supporting a serial line interface and scrollback support natively isn't?
Re:St – A simple terminal implementation for X by bobwaycott on Thursday February 02, 2017 @12:22AM (#13548323)
My first thought, as well.
Re:St – A simple terminal implementation for X by pmoriarty on Wednesday February 01, 2017 @11:14PM (#13548055)
Different people want different features. There's no way they're going to remain minimal and please everyone.

They have to choose the feature set, and if other programs can provide a feature that some users want, that seems like a feature ripe for pruning. I think they made the right choice.

Re:St – A simple terminal implementation for X by aidenn0 on Wednesday February 01, 2017 @11:27PM (#13548107)
I always find tmux's scrollback to be vastly inferior to a native terminal's though.

There are several reasons, but the biggest is that I'm pretty sure it's not possible to get more than a screenfull of text to my local X11 PRIMARY selection.

Re:St – A simple terminal implementation for X by pmoriarty on Wednesday February 01, 2017 @11:31PM (#13548131)
I just use tmux's native copy/paste mechanism, using the keyboard. Using that it's possible to get the full scrollback buffer, or any part of it.
Re:St – A simple terminal implementation for X by aidenn0 on Wednesday February 01, 2017 @11:41PM (#13548162)
And I want to paste it into a non-terminal application running locally while the tmux is on a remote host?
Re:St – A simple terminal implementation for X by fiddlerwoaroof on Wednesday February 01, 2017 @11:46PM (#13548182)
You can always use ssh and something like xclip or pbcopy.

Also, I always use mosh for ssh (when possible) so that I can recover my connection if I run into network issues. Since mosh works by synchronizing a virtual screen, I don't get scrollback at all without tmux or the like.

Re:St – A simple terminal implementation for X by fpqc on Thursday February 02, 2017 @10:52AM (#13551351)
I just added a feature to tmux-git that makes the tmux clipboard propagate up into higher clipboards for nested tmux. https://github.com/tmux/tmux/commit/4ede35c48c089abe3fca0d94...

Keep in mind that your terminfo has to support this, so make sure your ncurses-term package is the latest release from Jan 28.

I also made a patch for st to support OSC 52 propagation into Xorg, but it was rejected by the st maintainers because it uses base64 (as the OSC de-facto spec from xterm dictates).

The patch for st is however in a branch of the Wayland-fork of st

https://github.com/michaelforney/st/tree/selection

Another option if you use nested copies of tmux is to use this feature to get the remote clipboard into the local one, then yank with xclip.

Re:St – A simple terminal implementation for X by jacobush on Thursday February 02, 2017 @03:19AM (#13548978)
This. I like terminal scrollback but it's gone for me.
Re:St – A simple terminal implementation for X by jdormit on Thursday February 02, 2017 @12:57AM (#13548444)
'xclip -selection clipboard' works fine for this use case.

[Edit] Assuming you have SSH configured to forward to your local X server [0].

[0] http://unix.stackexchange.com/a/16697

Re:St – A simple terminal implementation for X by aidenn0 on Thursday February 02, 2017 @03:26AM (#13549000)
Unfortunately many ssh servers gratuitously disallow X11 forwarding; tcp forwarding can accomplish the same, but then setting up DISPLAY &ct. need to be done manually.
Re:St – A simple terminal implementation for X by fpqc on Thursday February 02, 2017 @11:02AM (#13551451)
In the latest git builds of tmux (with the latest terminfo db from ncurses), you can have clipboards propagate from remote tmux to local tmux (nested configuration) using the new OSC52 control sequence implemented in a patch from 2 weeks ago.

Also, if your terminal emulator (rxvt, xterm on Linux and mintty on Windows) support OSC52 escape sequences for clipboard setting, this means you don't need X11 forwarding anymore, since you can set your X11 clipboard from tmux.

If anyone can help me get in touch with the libvte people, I want to patch OSC 52 support in there as well, since this is a great feature that should _not_ be relying on X11 forwarding or whatever.

Re:St – A simple terminal implementation for X by fiddlerwoaroof on Wednesday February 01, 2017 @11:31PM (#13548127)
I know that there is an option for integrating tmux's internal clipboard with X11's but I haven't bothered with them because I prefer to keep the clipboards of the various terminal apps I use separate.
Re:St – A simple terminal implementation for X by fpqc on Thursday February 02, 2017 @11:04AM (#13551472)
It depends ultimately on the terminal to support it though. Only Linux terminals that support it atm are xterm and (u)rxvt, and there is an out-of-tree patch for st that I made (though it was rejected for being too long (around 40 lines).
Re:St – A simple terminal implementation for X by jakeogh on Thursday February 02, 2017 @02:48AM (#13548858)
And it's slow.
Re:St – A simple terminal implementation for X by generic_user on Wednesday February 01, 2017 @11:26PM (#13548105)
It is explained in the info that scrollback is implemented in dvtm. Duplicating the functionality would probably go against the general minimalist Suckless design philosophy.

    Non-goals:
    unlimited scrollback buffer (done by dvtm)
Re:St – A simple terminal implementation for X by brennen on Wednesday February 01, 2017 @11:35PM (#13548145)
Interesting. Thanks for the pointer to dvtm. I'm not sure I can see using it when I'm already fairly hooked on tmux, but it does seem kind of nice.
Re:St – A simple terminal implementation for X by self_awareness on Thursday February 02, 2017 @03:37AM (#13549034)
Alacritty uses the same argument against scrollback and tabs -- that these features should be handled by something like 'tmux': https://github.com/jwilm/alacritty
Re:St – A simple terminal implementation for X by tokenizerrr on Thursday February 02, 2017 @04:51AM (#13549343)
And then you have tabs that you can't copy from using your mouse because you wind up selecting content from multiple tabs.
Re:St – A simple terminal implementation for X by falsedan on Thursday February 02, 2017 @06:28AM (#13549748)
Most terminals have a column selection mode (e.g. Opt-click on Mac) hidden extremely deeply in documentation.
Re:St – A simple terminal implementation for X by unkiwii on Thursday February 02, 2017 @07:36AM (#13550075)
when I use tmux for scrolling inside st i can select text only in the current window/pane I'm and copy that text only, without the mouse obviously
Re:St – A simple terminal implementation for X by fpqc on Thursday February 02, 2017 @11:05AM (#13551498)
You can with the mouse as well. st doesn't support the OSC52 (Ms termcap) for setting the selection by this method, though I have an out-of-tree patch that does support it (also available as a branch in the Wayland port).
Re:St – A simple terminal implementation for X by cacplate on Wednesday February 01, 2017 @11:22PM (#13548090)
They use patches of the source code for plugin style functionality so it remains as minimal as they want and we can add features at will. There is one for scrollback
Re:St – A simple terminal implementation for X by hashkb on Thursday February 02, 2017 @11:11AM (#13551562)
What's the problem with typing tmux? I think this is exactly right for the typical audience of suckless projects. No dwm or dmenu users are complaining about "missing features".
Re:St – A simple terminal implementation for X by bch on Wednesday February 01, 2017 @11:41PM (#13548160)
...and does it not support pasting from the X clipboard ? It's not accepting in my installation, anyway... :/
Re:St – A simple terminal implementation for X by avhon1 on Wednesday February 01, 2017 @11:45PM (#13548178)
[modifier]+shift+insert or [modifier]+shift+v are the default bindings for paste. [modifier] is most commonly Alt or Super (the Windows key). Keep in mind that your window manager might already have a binding for these, preventing them from working.
Re:St – A simple terminal implementation for X by pmoriarty on Wednesday February 01, 2017 @11:43PM (#13548167)
I can paste in to it from the X clipboard using SHIFT-INSERT just fine.