274 points · by pmoriarty · 9y ago · 217 comments
Not everybody wishes to use a terminal multiplexer in all cases, either.
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.
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.
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.
It absolutely seems like very conflicting decisions user-experience wise.
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.
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.
Non-goals:
unlimited scrollback buffer (done by dvtm)>This software, which specifically states that it caters to a niche, doesn't cater to my needs. I'm not going to consider thought that I might not be part of the niche it's catering to and complain about it instead.
FIFY
Really? Generally accepted by who? My unscientific personal tests show that Gnome Terminal is the fastest and lightest VTE.
yes | head -n 1000000 > two_megs.txt
time cat two_megs.txt
You will definitely see a difference in the time it takes to complete or a libvte-based terminal, xterm, urvxt, roxterm, etc.OTOH I can google up posts saying that pt shows good results in comparisons like that, apparently using a TTF font. Hopefully the bitmap font performance problem is not due to the general design, but a regression in a special case.
In fact, I don't remember the details now but I recall looking at the source for another one of the suckless applications and finding some pretty inefficient algorithms. I think the other comment here about st being CPU-intensive with high output rates is an example of this.
Ironically, one of the reasons I think mainstream software sucks is because newer versions also tend to remove configurability and features often for the same goal of reducing bloat.
It's the same rationale that leads one to use a pen and paper rather than a note taking app.
I agree most of their stuff isn't targeted toward the average user, just this small niche. Their browser, surf, doesn't even support tabs as far as I can remember.
There is a general tabbing frontend that allows you to tab all sorts of applications: http://tools.suckless.org/tabbed.
I think it's fair to say suckless code is clean and minimalist. But it definitely isn't suckless.
Secondly, it's all very tongue in cheek. After all it's aimed at the OpenBSD crowd and like minded people. It's not really meant to be taken literally by the general computing audience - not even within the wider FOSS community.
Lastly it's sad day for HN when negative comments get up-voted and positive comments defending niche software get down-voted. What happened to respecting our peers and acknowledging the massively wide range of personal preferences and usage habits?
Then again, if they name their project(s) "suck less", it's completely fair to say it sucks. If they can have arbitrary standards about what constitutes suckage, why not us?
void (handler[LASTEvent]) (XEvent ) = { [ButtonPress] = buttonpress, [ConfigureRequest] = configurerequest, [DestroyNotify] = destroynotify, [EnterNotify] = enternotify, [LeaveNotify] = leavenotify, [KeyPress] = keypress, [MappingNotify] = mappingnotify, [MapRequest] = maprequest, [PropertyNotify] = propertynotify, [UnmapNotify] = unmapnotify };
What's this feature called?
http://stackoverflow.com/questions/18731707/why-does-c11-not...
BTW, shameless plug, but my own simavr uses these C99 features as more or less the whole basic structure on how multiple cores are described, see a sample core declaration [0] for example. The beauty is that there is no code involved in the declaration, it'll be 'const' too. Imagine the boilerplate you'd need to do that in C++!
[0]: https://github.com/buserror/simavr/blob/master/simavr/cores/...
From the st man page:
Alt-Shift-Page Up
Increase font size.
Alt-Shift-Page Down
Decrease font size.
Alt-Shift-Home
Reset to default font size.I can imagine there could be bugs in esoteric terminal emulation, but for the typical use case of "TERM=xterm-256color" (or screen-256color) it works perfectly for my use case.
I really like VTE's behaviour; even if the performance is a bit worse than XTerm (though worlds ahead of what I've seen on OSX with iTerm2 and Terminal.app). I rely on using iBus input methods in the terminal on a daily basis, and VTE handles this wonderfully.
We hack so much into a text interface it's really easy to accumulate bugs.
I rarely (never?) see any "terminal glitching" except for the cases where I've done something absurdly wrong, like running a bash inside emacs-shell with the wrong setting for TERM.
Terminal emulation is essentially a solved problem (state machines and control code sets are small and well defined, there are many reference implementations and compatibility tests). If you see glitching, it's probably from what you're doing inside the terminal, not from the terminal itself.
xterm is a de facto standard, in that you can sit down in front of a machine which appears to be running some flavour of Unix, it doesn't matter if it's Gnome, KDE, TWM, CDE, etc., GNU or BSD or Solaris or whatever, you'll probably be able to find xterm and work out the rest from there.
Many devs/hackers use xterm as their day-to-day terminal, and seem to approximate ANSI control code compliance with "works in xterm".
The problem with this situation, as mentioned on the st page, is that xterm is unmaintained and unmaintainable.
st is trying to be a maintainable replacement, making improvements like vector fonts, and not being shy about ignoring legacy/niche/solved-elsewhere features.
- xterm is for exactly the case you describe: when all you have is "base X11" and you need a terminal. No crazy multi-gigabyte toolkit requirements. Its essentially a fallback/recovery tool for these cases, although I prefer just working on console when things get that bad.
- xterm's codebase is 30+ years old. "unmaintainable" seems like an overstatement, by a longshot.
This appears to be true (from other comments on terminal performance in this thread) but other VTE-based terminals (gnome-terminal) have high performance and work great on sub-1GHz class machines.
What's more, many developers (myself included) aren't afraid of jumping into someone elses code and modifying it to behave how we want.
Let's also remember that a great deal of software you don't even think about also runs this way; they'll have config flags to add and remove features at compile time (run Gentoo or FreeBSD ports for a few weeks and you'll see what I mean).
So having hardcoded options isnt that ridiculous nor uncommon on Linux. However mainstream desktop distros do a good job at hiding that from their users by picking sane defaults for them.
Cool... Now I know that it's not just me that does this then. :)
Do you not build stuff that needs to run differently on production systems than development systems? Simple things like credentials or connection URLs.
If you're building an MVP then the first and foremost concern is getting a proof of concept product running. However to answer your question I don't really see how editing list of constants in an AOT compiled language is any worse than having to do the same in any of the hundreds of popular web solutions written in languages like PHP where they often embed config as source code variables. It's the same issues with hard coded settings in source code but the difference is how your continuous integration pipeline / code deployment scripts are configured. So it's quite an easy problem to solve once you look at the deployment automation.
Obviously the end goal would be to have readable configuration files for different environments. But pragmatically real world code often ends up being rushed and hacked to meet deadlines rather than nurtured, following industry best practices at every point throughout it's development cycle (assuming your company even has a documented development cycle. Many don't!)
Open ~/.xmonad/xmonad.hs. It's Haskell code, but frankly it reads like a configuration file, with a big list of shortcuts.
Edit the "code". You don't need to know Haskell, just follow the syntactic conventions you see there. Worst case, you have to search for configuration tips on the web.
Save xmonad.hs, hit the "recompile Xmonad" shortcut. You've now recompiled and restarted Xmonad, and all your windows are still where they were before. Application state survives recompilation.
For the vast majority of user-facing programs, run-time configuration is a must. A fancy GUI for it might be superfluous; a simple text file / command-line way to set options should always be available.
Edit-compile-run is a rather complicated way to tune font size compared to a slider.
And on that note, while I admire ST for its simplicity, I've been a happy user of Sakura for the past few years (though, sadly not on windows 10... I've yet to find a really good console for w10).
https://launchpad.net/sakura (page down at the moment...)
More often options are changed on the shell (ZSH in my case) Then even more often on tmux.
Here's the changelog: http://invisible-island.net/xterm/xterm.log.html
xterm is addressing a vastly broader audience than st.
I might work on it someday.
It's still the best terminal emulator out there. Incredibly fast in software-only, even better when hardware accelerated, skinnable and configurable.
Also there is still some niche software that still requires it (for example IRAF which sadly is still going strong in the astronomy community).
I really wanted st to work for me but something is wrong with the character sizing when using Source Code Pro (17pt) as the font. I installed this on my Arch laptop (a hidpi ThinkPad T460s) and something is seriously screwy with the fonts. At top is xfce4-termina; on the bottom is st:
I would report this to the author but I don't see any way to do so.
Notice the dotted zero in the top terminal (xfce4-terminal) and no dotted zero in the bottom terminal (st).
I suspect st is not recognizing the font name you're giving it, and to fix it you have to play around with different ways to telling st the name of your font. What worked for me for the Inconsolata font was "st -f Inconsolata" or "st -f Inconsolata:size=11".
Which one are you using? AFAIK urxvt is the only maintained fork. I could be wrong.
> I would report this to the author but I don't see any way to do so.
They're pretty big on "This is not #support. Post patch or GTFO" last I was there.
No screens there because there isn't anything to screen, it is just plain console without any GUI (supports scroll-back)
/*
* appearance
*
* font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
*/
static char font[] = "Liberation Mono:pixelsize=12:antialias=true:autohint=true";
Try to specify font name in this format.A few months ago I was having trouble with getting some TTF BIOS fonts recognized by urxvt and fc-list made me realize that I should've escaped a couple dashes in the font name.
Godspeed, I moved away from all suckless software because the developers are all massive jerks. They'll ignore your bug reports unless you spend an unreasonable amount of time doing intricate debugging, and if you refuse they'll be sure to remember your name and act hostile if you ever go back into their IRC. That's been my experience with Surf and something else (I don't remember what, but it wasn't st) anyways.
- Quadruple-click smart selection
- "Selection respects soft boundaries" for selecting within a tmux pane
- "Rum coprocess" on keyboard shortcut, which allows doing stuff like http://brettterpstra.com/2014/11/14/safer-command-line-paste...
I just checked, and gnome-terminal doesn't even have split-pane. What do you guys use, anyway?
Selecting within a tmux pane: you got me on that one. I'm not aware of a terminal that does that, but again, it should be possible to do with urxvt's perl extension feature.
Regarding the "safer command line paste", Linux can do the same with bracketed paste mode.[1]
For splitting panes, I just use tmux, vim, or emacs.
If you're looking for things like toolbelt, or built-in regexp highlighting, or other (arguably nice) bells and whistles, I suspect most of them would be provided by separate utilities. (Yes, it's a distant echo of the "Unix way".)
Bookmarks in scrollback are neat, though, and cannot be easily added by a third party. I don't remember an implementation, though.
Extraterm -> https://github.com/sedwards2009/extraterm
The visual tour page explains some of the ideas present. https://github.com/sedwards2009/extraterm/blob/master/docs/t...
But then someone recommended Terminator and haven't gone back since :) It feels like gnome-terminal on steroids. Love the multipane stuff.
I wish apps would stop implementing their own fullscreen functionality/hotkeys/etc, and we could all start relying on window managers (or DE's) to provide this.
On-topic, I really like that if I super+F firefox, it actually behaves full-screenish and hides the its bars. I wish most apps would do this.
#define LEN(a) (sizeof(a) / sizeof(a)[0])
I know precompiler magic is hard, and my C aint the bestbut it makes me wonder if the parens at the end make sense - shouldn't it be something like
#define LEN(a) (sizeof(a) / sizeof((a)[0]))
also asked here https://stackoverflow.com/questions/42001665/is-this-a-plain...Already have tmux which provides scollback, and I even get that in a try.
Only if surf was functional enough to be my daily driver.
which is why I use rxvt-unicode
There, I just saved you a ton of time :) Go read the next story.
And it depends on how you define "improvement" since this lacks features many would want. And I'm talking about features in native apps, not web-tech apps.