17 ms·
St – A simple terminal implementation for X
- smlacy 10y agoWhy do people care so much about terminal emulators and their supposed "bloat" and "complexity"?
- charlesetc 10y agoThere have been many times when vim starts glitching out or something because of the terminal emulator I'm using. Even well tested ones like X-term and gnome-terminal. I never had that problem using st. We hack so much into a text interface it's really easy to accumulate bugs.
- jjawssd 10y agoHave you considered using neovim?
- smlacy 10y agoI use tmux+emacs inside gnome-terminal for 8+ hours a day. 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.
- chrissnell 10y agoBugs. When you work all day long in a terminal, you need it to be reliable. As I mentioned above, xfce4-terminal is what I normally use but select-to-copy doesn't work 100% of the time. This is super annoying. I'd switch to rxvt but it has its own problems. Despite having had terminals for so much longer, *nix has fallen behind macOS when it comes to terminal usability and reliability.
- Ar-Curunir 10y agoTermite is pretty good and bug-free in my experience.
- microcolonel 10y agoPlug: I maintain a fork of termite which doesn't require Daniel's patched VTE3 fork; and guts most of the exotic vimmy features. 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. https://github.com/xorgy/termite https://github.com/xorgy/termite
- omtose 10y agoI've also gutted a lot of stuff from termite in my own fork (overaly, vi mode, clickable urls) and it definitely makes for a lovely minimalistic terminal. I'm thankful for termite being so simple (granted the lifting is done by a lib) that this is possible without much effort. I just wish I could log the scrollback buffer so that I could open an actual editor on it, but I don't think libvte exposes anything to do this.
- chrissnell 10y agoHey, thanks for the tip on Termite. I've been using it since reading your comment and it's awesome. Cut and paste and URL opening both work flawlessly!
- smlacy 10y ago
- Skunkleton 10y agoIts funny, but I have had fewer stability issues with gnome-terminal than I have had with st. Seems like most people have the opposite experience.
- shmerl 10y agoI care about functionality. Stuff like true color support helps reduce strain to the eyes.
- Pawka 10y agoPerformance.
- Karrot_Kream 10y agoNot everyone has the latest and greatest machine.
- smlacy 10y agoAre you saying that xterm has poor performance? 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.
- chriswarbo 10y agoThe way I see it, st is trying to replace xterm. 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.
- davidgerard 10y agoxterm is actively maintained and cares about a whole pile of corner cases that were enough for users to raise valid bugs. See the changelog: http://invisible-island.net/xterm/xterm.log.html http://invisible-island.net/xterm/xterm.log.html
- smlacy 10y ago- I dispute "many devs/hackers use xterm". I switched away from xterm over 20 years ago, when it was clear that they were never going to have good support for anti-aliased fonts. I work heavily in the linux and with linux devs, and I can't remember the last time I saw someone using an xterm on a modern system. - 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.
- charlesetc 10y agoI used st for a good year and it worked really well! I've switched recently for features like the ability to change the font size without recompiling, etc. Despite its spartan feature set, st is quite usable.
- corybrown 10y agoWhat do you use now? Keyboard shortcut for font size change is a must for me.
- pmoriarty 10y ago"Keyboard shortcut for font size change is a must for me." 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.
- charlesetc 10y agoI use konsole which is better than I found gnome-terminal to be and less klunky than I was expecting
- deleted 10y ago[deleted]
- pmoriarty 10y agoYou don't have to recompile st in order to change fonts. You can just pass it the -f flag with the font you want to use.
- mikejmoffitt 10y agoI 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.
- pmoriarty 10y agoDifferent 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.
- aidenn0 10y agoI 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.
- fiddlerwoaroof 10y agoI 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.
- fpqc 10y agoIt 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).
- pmoriarty 10y agoI 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.
- kookookabongers 10y agoI don't use C for a couple of years and I see this: 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?
- bonzini 10y agoDesignated initializers. It's in C99.
- kookookabongers 10y agoThanks. Oddly not in the C++ standard: http://stackoverflow.com/questions/18731707/why-does-c11-not-support-designated-initializer-list-as-c99 http://stackoverflow.com/questions/18731707/why-does-c11-not...
- buserror 10y agoYes it's strange, it's one of the reason I stopped using C++ as a matter of fact. Given the innate amount of code required in C++ constructor to initialize objects, you'd think that would be very handy. 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/sim_90usb162.c https://github.com/buserror/simavr/blob/master/simavr/cores/...
- chrissnell 10y agoInteresting. I've been wanting a better terminal for some time. rxvt is super buggy, especially with clickable URLs. xfce4-terminal is better but select-to-copy is flaky and doesn't always copy the text I select. 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: http://imgur.com/a/8ALoS http://imgur.com/a/8ALoS I would report this to the author but I don't see any way to do so.
- schwarze_pest 10y ago> rxvt is super buggy 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. http://suckless.org/community http://suckless.org/community
- qu4z-2 10y agoYou'll probably get yelled at to fix your font config if you report it, though. They're pretty big on "This is not #support. Post patch or GTFO" last I was there.
- pmoriarty 10y agoThe two terminals in your screenshots are using different fonts. 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".
- avhon1 10y agost does this when you don't give it the right font path and config. There is one compiled in, and that's what it's using if you aren't passing a font when you start it. Right now, whatever font it's trying to use doesn't exist, and your screenshot is a typical result of that.
- unfamiliar 10y agoI find terminal emulators on Linux to be woefully inadequate after getting used to iTerm2 on OS X. Can anyone recommend a Linux terminal emulator that even comes close in terms of features and performance?
- pmoriarty 10y agoWhat features do you need in iTerm2 that you find lacking in the Linux terminal emulators you've tried?
- donatj 10y agoI second this out of true curiosity. I have tried and never found any love in my heart for iTerm2. It just feels clunky and bloated to me.
- wruza 10y agoLast time I asked, someone said: "many features, but I like cmd-click to open path". After reading [1] I see that all it does is loading hipster-oriented "features" into your brain. Almost every feature is useless if you're doing any amount of actual work with decent cli tools. But for playing a hacker it is pretty cool. [1] https://www.iterm2.com/features.html https://www.iterm2.com/features.html
- kedean 10y agoThere's nothing wrong with features that give you access to the wider operating system. Like it or not, the modern operating system is more than just terminals and CLI tools, and there's no reason to be condescending to those who don't live exclusively in the terminal. A large part of what makes iTerm2 popular is how well it works in tandem with MacOS. Things like cmd+click to open (useful because you can use it on data that was spat out from a previous command invocation), paste filtering, and the fantastic built-in multiplexer/tabbing system. That said, most of what makes MacOS users like iTerm2 just wouldn't be as useful on any other operating system, because its so tightly coupled to the wider OS.
- michaelmrose 10y agoRecompiling software to change options is utterly and totally ridiculous
- matthewbauer 10y agoI kind of agree. But, how often do you change your settings after you've found the right ones? A minimalist would see runtime configuration as bloat.
- nine_k 10y agoFinding the right settings is a relatively slow process. Also, finding the right values for 80% of the settings is fast, but fiddling with the rest can take time. Trying something new also becomes harder. 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.
- ori_b 10y agoCompile times for me are 0.2 seconds. And there is a text file available, it's called config.h.
- nine_k 10y agoThis sort of rules out binary distributions, or changing settings on a remote machine where you don't have the build dependencies installed. The latter may be irrelevant for a terminal emulator, but not for the general case.
- fpoling 10y agoIn my experience if one can edit config files on a system, one has room to install a minimal C compiler. And one can distribute things in a binary form even if the config requires compilation. Consider distributing an application as a library or object files when the target machine needs to compile and link only the config file.
- wtbob 10y agoThis is my favourite terminal. I have it configured to run tmux, and couldn't be happier. Lightning-fast, stable as can be, it gets out of my way and lets me work.
- Girlang 10y agoThe Tektronix 4014 is _not_ obscure.
- someheavyocean 10y agoAs much as I love st, I had to stop using it recently. When using a bitmap font in tmux, large amounts of text sent to stdout bring my computer to a standstill. X is using 100% of a single core. I've switched to gnome-terminal and the issue is gone.
- nine_k 10y agoThis, along with the generally accepted notion that Gnome Terminal is one of the slowest with output, puts the whole minimalism idea under a serious question. "Do one thing, but do it well", the saying goes.
- microcolonel 10y agoCompared to Terminal.app and iTerm2, VTE (the widget underlying Gnome Terminal) is blazing fast.
- otabdeveloper1 10y ago> the generally accepted notion that Gnome Terminal is one of the slowest with output Really? Generally accepted by who? My unscientific personal tests show that Gnome Terminal is the fastest and lightest VTE.
- nine_k 10y agoYou can run a completely unscientific experiment yourself: take a really large text file, or just use `yes`, and time its full output on several different terminals. 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.
- davidshepherd7 10y ago
- eriknstr 10y agoPersonally I am enjoying terminology very much. https://www.enlightenment.org/about-terminology https://www.enlightenment.org/about-terminology
- xvilka 10y agoSadly Terminology doesn't have support for 24bit RGB sequences (true color): https://gist.github.com/XVilka/8346728 https://gist.github.com/XVilka/8346728
- billiob 10y ago(main developer of Terminology here) As stated on https://phab.enlightenment.org/T746 https://phab.enlightenment.org/T746, it is not an easy move due to the way the text grid is designed. I might work on it someday.
- vegabook 10y agoI love Terminology, and the entire 90s vibe of EFL and Enlightenment generally. So unashamedly not flat design in a world of Jony Ive / Google Material Design conformity.
- mxvzr 10y agounrelated: are you the billiob that used to contribute to aMSN back in the days?
- billiob 10y agoYes, I am!
- Aissen 10y agoIt's honestly not the most important limitation of Terminology (except maybe to you). It doesn't support re-ordering or renaming tabs. It doesn't support searching into scrollback. It doesn't fetch terminfo data. It's still the best terminal emulator out there. Incredibly fast in software-only, even better when hardware accelerated, skinnable and configurable.
- satai 10y agoI can't help myself: suckless sucks. Lots of arbitrary limitations for the code, need to recompile instead of configuration, optimizing for a wrong usage scenario.
- laumars 10y agoYou're clearly not their target audience if those are your takeaways. But there are lots of people out there who do prefer to recompile instead of configure and find suckless feature sets to be inline with their own requirements. To say that a product "sucks" because they don't cater specifically to your arbitrary desires is grossly unfair.
- kitchi 10y agoWell, I mean that's what they're doing as well. They call features other people use and require "bloat" and pretty much say they all suck. I think it's fair to say suckless code is clean and minimalist. But it definitely isn't suckless.
- mbrock 10y agoI think they're not trying to be suckless, but merely to suck less.
- laumars 10y agoFirst of all it is "suck less" not "suckless". ie "less bloat/features" rather than "hey look at our perfect software". This is a point reiterated on their site repeatedly (including the <title> tag on their home page: http://suckless.org/ http://suckless.org/) 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?
- nul_byte 10y ago> xterm is bloated and unmaintainable. which is why I use rxvt-unicode
- Zardoz84 10y agoI would keep using Konsole/Yakuake
- carmate383 10y agoIt really is fantastic to see a new _improvement_ on something like a terminal in 2017, that isn't written in Javascript / Coffeescript / Some other web technology that deploys 100+MB of libraries.
- auscompgeek 10y agost has been around for a few years now. But yes, it's good to see a decent, lightweight terminal emulator being somewhat actively maintained.
- haarts 10y agoAmen
- oblio 10y agoIt's not new. 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.
- sime2009 10y agoWhat exactly is the improvement here? a small code base? Is that all?
- hiq 10y agoIs there a full-screen mode? I often use it with gnome-terminal and the vim-goyo plugin, it's pretty neat.
- Lapsa 10y agousing i3 win+F here
- hiq 10y agoF11 does not work with gnome, I thought it was part of the Gnome DE and not implemented in gnome-terminal...
- hobarrera 10y agoTHIS! 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.
- cyborgx7 10y agoThis thread is like every thread on suckless software ever. >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.
- hncommenter_ 10y ago>This thread is like every thread on HN ever. FIFY
- fiatjaf 10y agoThat xterm README is from 1991. I believe it has improved a lot since.
- davidgerard 10y agoIt is also, in practice, actively maintained and gets bugfixes. It turns out there are a metric buttload of obscure corner cases that do need to work right. Here's the changelog: http://invisible-island.net/xterm/xterm.log.html http://invisible-island.net/xterm/xterm.log.html xterm is addressing a vastly broader audience than st.
- onli 10y agoWhich btw was my problem with it when using st. Corner cases like using nano under ssh just plainly did not work. Or copying stuff from the terminal that got linewrapped, if I get that wrap as a linebreak in the copy buffer it destroys the password I just copied, making it hard to use pass.
- daef 10y agoscrolling through http://git.suckless.org/st/plain/st.c http://git.suckless.org/st/plain/st.c I stumbled upon #define LEN(a) (sizeof(a) / sizeof(a)[0]) I know precompiler magic is hard, and my C aint the best but 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-bug-or-a-clever-precompiler-trick https://stackoverflow.com/questions/42001665/is-this-a-plain...
- kv-1 10y agoi'm not saying that the way they wrote it makes sense, but you have to remember that sizeof is actually an operator and not a function.
- daef 10y agojust got basically the same answer on stackoverflow - sizeof is an operator -> works w/o parens - makes sense - that's why i'm asking
- deleted 10y ago[deleted]
- residualmind 10y agoI've been using it as my main terminal for I think over 2 years, selected my patches, tweaked it a little. Great hackable little thing with comprehensible code.
- Lapsa 10y agosame here. my only gripe is that it seemingly doesn't support firacode (https://github.com/tonsky/FiraCode https://github.com/tonsky/FiraCode)
- fb03 10y agoITT: A lot of hate about suckless software and harsh ideological discussion. There, I just saved you a ton of time :) Go read the next story.
- hobarrera 10y agost lack support for a fallback font, so I can't have emoji on my terminal, and that really breaks my workflow because I'm sure I'll eventually need to see an emoji on the terminal for some reason, so I've dedicated hours tweaking this just to be ready for that moment.
- abjectcircle 10y agoThis should be accomplishable by tweaking fontconfig.
- jjnoakes 10y agoThe code does unsafe things in signal handlers (vfprintf, for example), and hides some things in macros that I wouldn't expect to see hidden (like the assignment of the global "argv0" variable, defined in st.c, is assigned in a macro from arg.h).
- pizza 10y agoprevious discussion: https://news.ycombinator.com/item?id=8661282 https://news.ycombinator.com/item?id=8661282
- welterde 10y agoxterm's support for the Tek graphics terminal is actually quite neat, since you can use it with for example gnuplot to plot things over a (bad) SSH connection. Also there is still some niche software that still requires it (for example IRAF which sadly is still going strong in the astronomy community).
- datenwolf 10y agoIndeed it is and not just for that. When I developed the firmware for our my company's laser product I exhaustively used the Tek graphics support for debugging purposes. Kind of neat if you've got only a serial connection and have to plot graphs. Much better than dumping it into a file and plotting it with gnuplot.
- hendry 10y agoI use st & I made a video about tmux since I am dependent on it :) https://www.youtube.com/watch?v=HCvFw3hfvxU https://www.youtube.com/watch?v=HCvFw3hfvxU
- adamryman 10y agoI love using this terminal. It is extremely fast and does what it suppose to perfectly. 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.