Hacker Newsnew | past | comments | ask | show | jobs | submit | ilyagr's commentslogin

If you want the `-X` behavior only some of the time, see https://news.ycombinator.com/item?id=46472859. (Maybe I should've posted it in this thread)


There's a way to make `^q` quit `less` and not clear the screen (like `less -X`), while `q` quits `less` and clears the screen (like normal `less`).

1. Do `echo '^q toggle-option -redraw-screen\nq' >> ~/.config/lesskey`

2. Make sure `less` is invoked without `-X` (or with `-+X` if you want to be sure).

This `^q` command is particularly useful for `git log` output and other things where you might need to refer back to them in the next terminal command you do. (In fact, `git` uses `less -FRX` by default, so you'd need to override its config to use `less -FR` instead for the above to work as intended). The `q` command is useful when you don't want to lose what you had on the screen before invoking `less`.


Actually, it would be more correct to do

    echo '^q toggle-option -redraw-on-quit\nq' >> ~/.config/lesskey
The original version I suggested works too, but by accident. `redraw-on-quit` is the actual option name.

(I'd edit my original message, but it's too late for that)

----

Also, note that if you put `--redraw-on-quit` into your `LESS` config (and not `-X`), and set up `^q` as above, things will still work but with flipped behavior of `q` and `^q`.

If your version of `less` is new enough, I believe that the `--redraw-on-quit` behavior is in every way (slightly) better than the `-X` behavior. In addition to the above, some terminals have special behaviors in alternate screen (like converting mouse wheel to up/down keys), which `--redraw-on-quit` will preserve.


See also https://github.com/jj-vcs/jj/wiki/JJ-Con-2025 for a list of all the talks, their slides, and some additional notes. I think the slides are also linked from youtube, but the website definitely has them.


VS Code now has an OKish git graph built-in, in case you didn't know. This feature is a few months old.


Yeah I did but it's merely OKish as you said. Git Graph is still significantly better.



If you're like a quick fix, see https://ghostty.org/docs/help/terminfo#copy-ghostty's-termin.... If that doesn't work, perhaps one of the other suggestions on that page will.


According to the link, the patents in question expire in 2028.


One option is https://github.com/binpash/try

It is Linux-only, though.


https://github.com/Wilfred/difftastic/wiki/Structural-Diffs is a nice list of alternatives.

Difftastic itself is great as well! The author wrote up nice posts about its design: https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fan..., https://difftastic.wilfred.me.uk/diffing.html.


In case anybody happens to be interested in testing `gumtree` with https://github.com/jj-vcs/jj, I think I got them to work together. See https://github.com/GumTreeDiff/gumtree/wiki/VCS-Integration#... (assumes Docker).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: