6 ms·
Terminal Smooth Scrolling
- okasaki 3y agoHmm, not sure. The first thing I do in Firefox is disable smooth scroll. And in a terminal I'm usually scrolling with pgup/pgdown or using search in a pager. Scrolling line-by-line at a fixed speed like in the video is very rare.
- Findecanor 3y agoI also have a TamperMonkey script installed to prevent web sites from hooking the arrow keys to do smooth scrolling (or worse: navigate to another page). I'm sure there must be several out there but the one I use is: <https://github.com/isaacl/keycodeScript https://github.com/isaacl/keycodeScript> with PgUp/PgDn/Home/End (33, 34, 35, 36) added.
- hexo 3y agoThank you very much!! I too find any kind of smooth scrolling very off putting, and was looking for this fix for a long time.
- csdvrx 3y ago> Hmm, not sure. The first thing I do in Firefox is disable smooth scroll. On Edge I do the same with `edge://flags/#smooth-scrolling`, but I've found there're 2 separate usecases, one where smooth scrolling helps, and one where it doesn't, and a separate usecase where the scrollbar stands in the way: - when scrolling with page up/page down, whether on Edge or on a terminal scrollbuffer, the tactile feedback of which key is pressed, and how often, is enough to keep track of the position. the scrollbar provide extra hints - when scrolling with the mouse, the smooth scrolling provides all the information I need. the scrollbar only helps me know if I'm close to the bottom of the page - when not scrolling but reading, the scrollbar is redundant and distracting. I like the new UI hiding the scrollbar, because I can better concentrate on the text. Another flag I love in edge is `edge://flags#enable-force-dark` with `selective image inversion based on transparency and number of colors`: it gives perfect dark mode on every website, with no plugin needed!
- perryizgr8 3y agoI want to try it but I'm not sure how to? The author gives a control sequence to enable it, but I don't see a download page or git repo.
- neuromanser 3y agoProbably https://flak.tedunangst.com/post/vertigo https://flak.tedunangst.com/post/vertigo
- ciex 3y agoThe article mentions `.vimrc`, which matches the format of the lines starting with `set ...` but that does not result in smooth scrolling for me.
- hackernudes 3y agohttps://humungus.tedunangst.com/r/vertigo https://humungus.tedunangst.com/r/vertigo Took way too long to find the link!
- stevebmark 3y agoDoes enabling smooth scrolling require downloading the author's custom shell? If so, this article should be flagged as misleading.
- whartung 3y agoWe had smooth scrolling on the VT-100. I hated it. I found it far too slow, even on low baud rates. The line was there, and you’re just waiting for it to materialize. This was a far different experience from watching the cursor crawl across the screen. There you didn’t know what was coming next. With the smooth scrolling, you did and were just, stuck, waiting on it. Personal taste, to each their own, but I hated it.
- deleted 3y ago[deleted]
- csdvrx 3y ago> We had smooth scrolling on the VT-100. I hated it. I found it far too slow, even on low baud rates. It's a feature you can configure > Personal taste, to each their own, but I hated it. I have trouble understanding how someone can hate an optional feature. What you might hate is the default configuration. I've heard people complain about desktop switching effects on hyprland, saying they are too slow. I've found they're helpful visual hints, but we all have different preferences for "speed" By making the desktop switching effect happen within a smaller time budget, they are not intrusive at all. It's less "buttery smooth" but it feels better than the lack of animation, or the slowness of perfect buttery smooth: it's as if the visual system of the brain could use this extra information to better interpolate and keep a visual map. If you want smooth scrolling in the terminal, yet want to scroll text very fast (like when looking for patterns inside binaries), maybe drawing the pixel lines by packets of 5 will achieve the speed you feel comfortable with, while still providing hints to your visual system.
- startaq 3y agoHere's how smooth scrolling looked on a real terminal: https://i.imgur.com/S44JaCh.mp4 https://i.imgur.com/S44JaCh.mp4 This is the Falco 5220e terminal emulated by MAME. It's running the vttest tool.
- rbanffy 3y agoIt looks awesome (would be nicer if it could be sped up, however).
- FullyFunctional 3y agoEven better if the speed would ramp up and down smoothly. I have missed this since I used smooth scrolling CP/M computers in the '80es.
- rbanffy 3y agoThat's something we could do in modern windowed terminals...
- bitwize 3y agoActual terminals used to do this, like the DEC ones. The Tandy 2000 (non-IBM compatible DOS PC) could imitate this behavior as well, enabled with a keyboard toggle.
- stuaxo 3y agoText mode on the PC had it, or at least VGA and probably EGA.
- NovemberWhiskey 3y agoThat's not at all my recollection! Have you got an example? As far as I know, VGA text modes were character-ROM based with a 16 bits per text buffer cell (8 bits each character/attribute) and so there's literally no way for this to work.
- bitwize 3y agoYou could program the scroll registers to achieve pixel-level scrolling for the entire screen or, if you got even more clever, part of the screen. But there was no toggle to enable this behavior for all scrolling in text mode.
- NovemberWhiskey 3y agoOK sure you can do all kinds of cunning stunts with the CRT controller registers but that's not a capability of text mode in VGA per se.
- bitwize 3y agoSorry, should've responded to stuaxo with that.
- peterfirefly 3y agoYou don't need tricks to do it with VGA. There is a register specifically for that purpose. You can do it with CGA as well but that does require tricks. (Like reprogramming the CRT controller on the fly to have reduced height lines at the top and bottom of the screen while doing the smooth scroll).
- csdvrx 3y agoFor a good companion to smooth scrolling, check out parallax background scrolling: https://www.reddit.com/r/unixporn/comments/v2jb9o/wezterm_parallax_background_scrolling_now/ https://www.reddit.com/r/unixporn/comments/v2jb9o/wezterm_pa... A programmatic "infinite parallax wallpaper" made of a few shaped blobs (to avoid making the foregound text hard to read) could help our visual system (build for a 3d world) keep track of the scrolling text without doing smooth scrolling directly, and without the helping "visual hints" scrollbars provide.
- gorkish 3y agoI guess I should have expected that wezterm was 3 steps ahead of this 2 years ago.
- jasonjmcghee 3y agoI have never been able to do transparency or background images in a terminal- it's so distracting to me. I'd be interested to hear comments from someone who likes this and if it's difficult to read and they don't care or make other modifications to increase contrast etc
- csdvrx 3y ago> I have never been able to do transparency or background images in a terminal- it's so distracting to me. Maybe this is a problem of the background image you've selected? Or maybe you don't like it 100% of the time? I like calming background images, especially when they are animated, and turned on and off at whill. I have a hotkey to toggle a nature scene: I've found that it helps me concentrate when I'm thinking about a coding problem: demo in https://www.reddit.com/r/unixporn/comments/11w3zzj/hyprland_wayab_hyprland_animated_background_forest/ https://www.reddit.com/r/unixporn/comments/11w3zzj/hyprland_... The bottom part of the image has subtle movements (the wind effect on the grass)
- jasonjmcghee 3y agoDon't get me wrong it looks great! Very aesthetically appealing. "unixporn" is appropriate. The shortcut key idea is interesting. I have nice syntax highlighting /colors / statusbar / desktop wallpaper etc but if I'm trying to write / read terminal / code, contrast is king. What I'm kind of grokking from your comment is the text on image just doesn't really bother you
- dboreham 3y agoThe original misfeature.
- addandsubtract 3y agoHow long until we have the technology to scroll with our trackpads?
- Avamander 3y agoI don't understand the downvotes. Most terminal emulators have sucky laggy scroll (that becomes super visible with the type of scrolling you do with a trackpad) and I'm not aware of any that do pixel-level smooth scrolling. Which is sad, smooth scroll works really well with such 1:1 input devices.
- deathanatos 3y ago… such as? Trackpad scrolling works fine for me, in everything I can think of. (macOS+Terminal.app => seems fine. macOS+iTerm2 => seems fine. Linux+Terminator => seems fine.) (Terminator will even scroll to partial lines with the trackpad. It won't do the sort of scrolling described in the OP, though … but that's not "sucky laggy scroll", either.)
- csdvrx 3y agoI think it's an issue of separating keyboard/trackpad/mouse scrolling: it may be beneficial in some cases, it may be burdensome in others. I wouldn't like smooth scrolling when I use PageUp/PageDown, unless it added minimal latency, because for full pages it would break the illusion. However, it may feel natural and normal with small and precise movements like multiple finger trackpad scroll for a few lines - at least if there's an acceleration curve to reduce the fps for large movements (many lines, or quick movements to scroll by full pages): it would help keep the perception of a low latency between the action and its "immediate" execution.
- 3np 3y agoWhich ones? I'm on relatively modest hardware and just scrolled my hardest using a trackpad in urxvt, xterm, xfce4-terminal, gnome-terminal, and they're all practically instant. You'd need to _introduce_ lag to have any pixel-by-pixel smoothing even be noticable. I consider pixel-by-pixel scrolling unnecessary eye-candy not worth the tradeoff. Consider that the capabilities in both hardware and software to do smooth/pixel-by-pixel scrolling in terminals have been around for decades - the reason it's not more common isn't necessarily technical. You may have a different preference but that doesn't make the status quo sucky, laggy, or sad.
- bravetraveler 3y agoI find statements like 'incompatible with how your...' to be a bit of a smell. For example, I don't follow the messages. I read them. Or, really, parts of them. Raw, un-smooth scrolling, and a high-refresh rate display means I can fix my eyes in one spot and consume the matrix
- Waterluvian 3y agoYeah I’m not sure about it being “incompatible.” It’s really just a framerate thing. In both cases we move a whole line in x millseconds. And either we’re rendering in-between frames or not. People have different needs and and wants when it comes to framrate.
- Dylan16807 3y agoIt also introduces delays. And if you're doing anything more complex than holding down the scroll button, the illusion of "either we’re rendering in-between frames or not" can disappear, because of frames on either side of the move that prove the speed is not consistent between smooth and non-smooth.
- Waterluvian 3y agoOh that’s true. It adds extra latency at the start and end of a scroll.
- LispSporks22 3y agoI remember writing my own smooth scrolling file viewer on DOS. You could use the character registers for the display controller (think it was VGA, 80x25 mode). Not novel, but fun way to get more resolution than you have but for narrow use cases.
- djmips 3y agoNot novel but it was esoteric. I remember a friend showing off his own custom communications software with smooth scrolling at work and we were all blown away with how cool it was.
- ckdot2 3y agoThis is default on Mac if you use the Trackpad. Just to be sure I just tested with "man ls", which is also used in the example video. If I use my keyboard, I prefer to not have smooth scrolling.
- deathanatos 3y ago… it … isn't? I too have just tested it (with `man ls`, in Terminal.app), and it scrolls by whole lines. (Same in iTerm2. In Linux, Terminator can scroll to partial lines, but output is instant, so it doesn't have the effect the OP is looking for.)
- josephg 3y agoScrolling with the trackpad is continuous and smooth in Terminal.app. On macOS I often prefer to cat files and then scroll them myself because of how nice it feels - and how much direct control I feel like I have over the scrolling position. I wish it worked with man pages, vim and less. But that sounds like a hard problem.
- Cyphonetic 3y agoIt does if you scroll fast enough, but at a certain speed it reverts to whole lines.
- NovemberWhiskey 3y agoOne of the basic problems here is the semantics of "scroll". If you have a full screen of text and then "add a line at the bottom" then you're going to scroll everything up by one line. That's pretty clear. Similarly, if you have a text editor that divides the screen into two horizontally-tiled buffers, you can define the scroll region (top margin/bottom margin) appropriately and have the same semantics. But if you have vertically-tiled buffers (open Emacs, C-x 3) then the top margin/bottom margin model no longer works. If you "scroll" one of those buffers, you are doing it to both of them, and you need to overpaint the other one afterwards; on a fast enough connection that's invisible within standard terminal semantics but will have odd visual artifacts for a smooth scroll.
- o11c 3y agoThe TTY sequences to insert or move lines give all the information needed to avoid scrolling other parts of the screen. Like most other things in the comments here, this is addressed in the article.
- NovemberWhiskey 3y ago>The TTY sequences to insert or move lines give all the information needed to avoid scrolling other parts of the screen. Certainly for VT100 they do not - you can define the scroll region, but it's strictly "between line x and y" or "the whole screen" and you can only scroll up/down the entire region. The article only address smooth scrolling of entire lines. How do you "scroll only the buffer on the right side of the screen"?
- j4_james 3y agoOn later DEC terminals you could also set left and right margins (lookup DECSLRM). They didn't support smooth scrolling when those margins were enabled, but I don't see why a modern terminal emulator couldn't handle that.
- mmh0000 3y agoI absolutely hate smooth-scrolling. It's one of the first things that I disable. I can't stand the way smooth-scrolling "feels,"... "mushy," and "laggy" are the best words I can think of to describe it.
- fellerts 3y agoSame, I react viscerally when an app implements smooth scrolling. Fixed increments is an absolute must. It’s interesting how different people can be.
- josephg 3y agoOn Linux? Do you hate it on macOS as well? I’ve used Macs for a number of years - and on macOS, mouse scroll events have been very “precise” for a long time - sending scroll events in fractions of a line. Scroll isn’t a button. It’s an axis. It feels great - because you have direct, continuous control. I moved to Linux mint a couple years ago and tried to bring my Apple magic touchpad with me. (I prefer it over a mouse while coding.) Linux has APIs which return precise scroll offsets, but a lot of apps don’t use them. Instead, Firefox will wait until I’ve scrolled an entire line worth, then emulate a smooth scrolling event to “catch up” to the scrolling I’ve already done. It feels horrible. Mushy and laggy are the right words. IntelliJ has the same problem - I assume precise scroll events don’t survive whatever event library they’re using. I’ve given up and gone back to a mouse on Linux. And turned smooth scrolling off. Smooth scrolling is a great idea - but for my money it’s only worth it if you have direct, continuous control over the scrolling position. And unfortunately on Linux (and probably windows) that’s held back by bad software support.
- zh3 3y agoMaybe it's just what you're used to - having got a Mac for the "premium experience", I found it sluggish and slow (albeit compared to a stripped down X11 system, rather than a full-on compositor experience)
- toast0 3y agoI seem to recall smooth scrolling on the Mac having the same basic issue as elsewhere. It takes an instantaneous scroll input and turns it into an animation. Scrolling half lines is fine and all, but I want the scroll position to jump to where it's going; possibly with multiple jumps if my input is over several frames.
- amelius 3y agoYou need to have a realtime OS to make it truly "smooth".
- Pinus 3y agoI remember actual hardware terminals doing this. I also remember keeping it turned off, partially because it was slow (as many others have already said), but also because I felt weird when scrolling one line at a time. As I remember it, there was no ease-in or ease-out to the motion, but instant transitions from standing still to rolling speed to standing still again. Jerky. Anyway, what I don't remember is: Could typical hardware terminals do this with a scroll region, or only with the whole screen? For a full-screen scroll, I suppose one could quite easily move everything by gradually offsetting the vertical sync a bit, but for a block of lines there would have to be something more complicated, like offsetting the input to the character generators for some scan lines. Is that what they did?
- junon 3y agoNot sure historically but at least doing some OLED programming these days it's often the case they support changing where the pointer starts (in terms of rows or columns) and allowing the behavior of wrapping the cursor around, meaning that when you'd do a full scroll the rows simply wrap around. If you don't overwrite anything in the video memory, then you just see the content from the top/bottom show up at the bottom/top, but if you did (e.g. to implement efficient whole-screen scrolling) you just had to re-paint the lines that were offset, instead of the whole screen. NES (a 6502, if it matters) had a different approach, where you had four sections with their own memory regions for tiles and sprites. You'd then tell the NES how to lay them out, e.g. if they were next to each other, how they'd wrap, if one was duplicated to another slot, etc and then the scrolling was handled by hardware. This is how Super Mario implemented the long sprawling levels (and I believe why the first wouldn't let you go back). As for e.g. VGA buffers on x86 for example, as far as I know there's no (standard) way to have them shift. I could be wrong. However I've had to write a few vertical scroller rasterizers before for VGA buffers and I've always done them manually, usually with some cleverness to avoid actually writing to the buffer when it wasn't necessary (since that hit a memory mapped region and thus was much slower than RAM).
- toast0 3y agoYou can set the Start Address to shift the display [1], I haven't used this in graphics mode, but in text mode, if you set the line offset to 128, in 80x25 mode, you get easy scrolling (still line based though) with wrap around or you can use the offset register to start at 0 at a given scanline [2]. I think I picked up this technique from this article [3] Edit to add; looks like you can do line based scrolling in text mode with the Preset Row Scan register [4]. Edit to add again; I think there's similar stuff in Vesa Bios Extensions (i set a SetDisplayStart, but I'm not sure I see a equivalent to the offset register), but if you're using a UEFI GOP framebuffer, I don't think there's anything similar, and you have to manage scrolling yourself. :( [1] http://www.osdever.net/FreeVGA/vga/crtcreg.htm#0C http://www.osdever.net/FreeVGA/vga/crtcreg.htm#0C [2] http://www.osdever.net/FreeVGA/vga/crtcreg.htm#13 http://www.osdever.net/FreeVGA/vga/crtcreg.htm#13 [3] http://www.os2museum.com/wp/dosv-graphics-text-modes-and-scrolling/ http://www.os2museum.com/wp/dosv-graphics-text-modes-and-scr... [4] http://www.osdever.net/FreeVGA/vga/crtcreg.htm#08 http://www.osdever.net/FreeVGA/vga/crtcreg.htm#08
- aragonite 3y agoWhat exactly is the modern definition of "smooth scrolling"? How is it supposed to differ from non-smooth scrolling? For example, in VSCode, I've toggled the "editor.smoothScrolling" setting from true to false and back without perceiving any noticeable difference. This is also true for several other applications where I've tried the same thing. I understand the concept of 'smooth scrolling' as it was traditionally defined in opposition to "scrolling by lines" (like when using ctrl+up/down in VSCode), where the movement occurs in discrete increments. In modern apps where scrolling generally seems continuous regardless, the distinction is unclear to me.
- dark-star 3y agoI think the video on the linked page sums it up pretty nicely: Default scrolling is line-by-line, i.e. the whole screen moves up by 16 pixels (or whatever height your font is) and the new line gets printed on the bottom. Smooth scrolling is when the screen moves up pixel by pixel It might not be noticeable in a text editor, but it sure looks impressive in a terminal since you can actually read while it scrolls. On whether that's useful or not will probably depend on the actual use-case (and user), but it sure looks impressive BTW, the DEC VT320 did this too, some 30+ years ago: https://www.youtube.com/watch?v=tSJfzrSA0ec https://www.youtube.com/watch?v=tSJfzrSA0ec
- aragonite 3y agoThanks for the explanation and the link. This is exactly how I've always understood 'smooth scrolling' to mean. What I'm confused about is what exactly am I toggling when say I toggle the 'Use smooth scrolling' setting in Firefox, or the 'editor.smoothScrolling' setting in VSCode. I just never was able detect any difference. Maybe it's as you said, the effect is just very subtle.
- baal80spam 3y agoScrolling feels completely different with smooth scrolling setting on and off, when you use mouse wheel to scroll. I always keep it off.
- m463 3y agoSomehow I wonder if there's a 60fps type enhancement here. the smooth scrolling looks jerky. that said, I like smooth scrolling lots better than the original IBM PC CGA adapter that had blink scrolling. I think they just turned of video, otherwise they would have gotten snow.
- 7sidedmarble 3y agoI absolutely love smooth scrolling in the VTE terminals on Linux, but I can't find anything other than maybe the default terminal app (which I don't like) and iterm2 (which I don't like) that does it on Mac. As the author said, just about every terminal has a GH issue open asking for it with nothing but 'this would require rewriting a lot'
- hibbelig 3y agoI wasn't able to get smooth scrolling on Terminal.app nor iTerm2. But I would love to.
- NelsonMinar 3y agoWindows Terminal is pretty good and a new terminal emulator written in the last few years. No smooth scrolling, here's the GitHub issue requesting it: https://github.com/microsoft/terminal/issues/1400 https://github.com/microsoft/terminal/issues/1400 VS.Code's supports smooth scrolling in both the editor and terminal window, but it's off by default. There's settings for it.
- MisterTea 3y agoNever did I sit there thinking, you know what would make this terminal experience better? Credits.
- alberth 3y agoTed Unangst For those unaware, Ted is a core developer of OpenBSD. An interesting interview with him can be read here: https://www.undeadly.org/features/2015/10/beastie_pl_interviews/ted-unangst.html https://www.undeadly.org/features/2015/10/beastie_pl_intervi...
- deleted 3y ago[deleted]
- noergl 3y agoWow, so much discomfort expressed here about slow scrolling. Are we all adopted to read tons of pages of terminal output flying by? I'm certainly not, and XOFF doesnt work anymore in many setups. Pagers for the rescue, though not working everywhere...