1
1
mirror of https://github.com/walles/moar.git synced 2024-09-11 20:17:13 +03:00
Commit Graph

98 Commits

Author SHA1 Message Date
Johan Walles
3543b2ca5f Forgot this in the last commit 2024-06-30 09:09:38 +02:00
Johan Walles
f9e5031cbe Safer shutdown
Now without closing stdin. That closing may or may not have been causing
problems on Windows.
2024-06-30 08:25:48 +02:00
Johan Walles
b2b69852e2 Make Windows screen shutdown more robust
Relates to <https://github.com/walles/moar/issues/217>
2024-06-29 13:32:12 +02:00
Johan Walles
2aa84811dc Support editing piped input
By writing it to a file and opening the editor on that file.

Related to https://github.com/walles/moar/issues/211.
2024-06-28 06:57:26 +02:00
Johan Walles
83dffa6e1f Make shutdown more reliable
At least I hope it is...
2024-06-24 20:05:34 +02:00
Johan Walles
69bef3097c Fix crash on --quit-if-one-screen by dupping stdout 2024-06-24 07:26:42 +02:00
Johan Walles
e73a70a4bd Fix terminal editor lagginess
After pressing 'v'.

By stopping our main loop before launching the editor.

Before this change our main loop was still running, stealing events from
stdin and the launched editor.

Fixes #213.
2024-06-23 12:41:31 +02:00
Johan Walles
f1e886624e Mouse copying in VSCode and IntelliJ
Selecting text now works by default with these terminals.
2024-05-06 06:48:59 +02:00
Wallunen
e5a600b51d
Use 24-bit color if COLORTERM=truecolor is in the environment 2024-02-10 02:56:00 +02:00
m154k1
23ec0e3816 Use the "select" mouse mode on Rio 2024-01-27 00:30:54 +02:00
Johan Walles
b18dd4f943 Only request terminal bg if needed
Fixes #190 and #191.

4 realz.
2024-01-20 08:34:59 +01:00
Johan Walles
1249f08c10 Probe terminal colors on the alt screen
This may or may not prevent #190 and #191.
2024-01-19 22:27:23 +01:00
Johan Walles
cc665778e1 Support another terminal color response format
Related to (but I can't see how this would fix) #190.
2024-01-18 21:36:16 +01:00
Johan Walles
0d504e950d Cosmetics 2024-01-13 12:43:29 +01:00
Johan Walles
30c40dc0a7 Get terminal background color asynchronously 2024-01-13 12:36:26 +01:00
Johan Walles
0ddefbdeb7 Move background color detection code into twin 2024-01-13 11:52:01 +01:00
Johan Walles
f6571b3942 Improve color downsampling
Tested on the green-gradient.txt sample file, looks much better after
this change.
2024-01-12 15:01:37 +01:00
Johan Walles
ba00295011 Render non-breaking spaces
As spaces. Go's unicode.IsPrint() doesn't consider them printable, but
they are just spaces so we should print them anyway.

Just tested this in ITerm2 and it works fine.
2024-01-11 09:33:23 +01:00
Zack Cerza
06c13120d0 Use the "select" mouse mode on WezTerm 2024-01-03 10:40:49 -07:00
Johan Walles
ff74c2d27c Handle warnings in twin 2024-01-01 13:39:30 +01:00
Johan Walles
e80c60439b Revert "Merge branch 'johan/ui-colors-from-chroma'"
This reverts commit ed491742a1, reversing
changes made to 12f316f8c8.

Before this goes in, we should first auto detect bright vs dark terminal
background and default to different themes in those two cases: #67
2023-12-28 18:42:04 +01:00
Johan Walles
a99c17012b Merge remote-tracking branch 'origin/master' into johan/ui-colors-from-chroma 2023-12-20 18:32:52 +01:00
Johan Walles
b103f0c10b Drop redundant dependency
Chroma already provides enough color handling for our needs.
2023-12-20 18:28:07 +01:00
Johan Walles
22885dc4b0 Test looping over all styles' background colors 2023-12-20 16:15:29 +01:00
Johan Walles
d13e9d4994 Improve naming 2023-12-20 14:59:55 +01:00
Johan Walles
8ec3df792a Use "select" as a term for selecting text
This is a better term, as pointed out by @postsolar in #173
2023-12-19 09:20:02 +01:00
Johan Walles
d511e50652 Downsample colors to terminal palette
As neeed.

This enables you to view 24 bit color documents in a 256 color terminal.
With reduced quality obviously, but still.
2023-12-19 08:47:40 +01:00
Johan Walles
a3f1c6118d Document Contour mouse marking 2023-12-18 19:52:10 +01:00
Johan Walles
ccc535074d Improve foot terminal detection 2023-12-18 09:53:31 +01:00
Johan Walles
21afb4f2ef Don't track the formatter
They are only needed at startup, so let's not keep them around while
paging.
2023-12-17 16:09:29 +01:00
Johan Walles
b067a84b36 Auto configure mouse settings in more terminals
Tested all the Linux ones in Virtualbox. Yay Virtualbox!
2023-12-16 18:59:58 +01:00
Johan Walles
4468a6528c Add command line options for setting the mouse mode 2023-12-15 21:36:29 +01:00
Johan Walles
a6f188e0ea Set mouse mode by terminal
Some terminals convert mouse events to key events making scrolling
better without our built-in mouse support, and some do not.

With this change in place, on those we know that do this, we let them
handle mouse events instead of enabling our built-in mouse scroll
support.
2023-12-14 03:06:13 +01:00
johan.walles@gmail.com
eb48418c10 Add another hyperlink test
Seemed there were no tests for hyperlink rendering.

Now we at least have two.
2023-12-13 09:27:05 +01:00
johan.walles@gmail.com
14c2351e53 Reset hyperlinks properly to unstyled
Before this change, if you had a hyperlink followed by unstyled text,
moar wouldn't reset the hyperlink property, messing up everything after
it.

With this change in place, that now works as one would expect.

Fixes #169.
2023-12-13 09:26:50 +01:00
Johan Walles
ddd7aec274 This is benign
So log it as debug rather than warning.

Ref: https://github.com/walles/moar/issues/164#issuecomment-1831255422
2023-11-29 14:03:55 +01:00
Johan Walles
0e27391c53 Bump event queue size
Fixes #164

Or at least that's the intent, I'm unable to test this.
2023-11-13 13:17:20 +01:00
Johan Walles
ae34878ee5 Document assertions
To clarify questions from #163.
2023-10-14 08:43:18 +02:00
Wallunen
6f2691ca10
Fix tests in twin/screen_test.go 2023-10-14 06:04:13 +03:00
Wallunen
3f1457aacb
Fix rendering of whitespace lines 2023-10-13 19:58:41 +03:00
Johan Walles
123b3c3692 Complete mutation coverage 2023-10-10 21:38:03 +02:00
Johan Walles
40a5ab1430 Cover one more mutation 2023-10-10 21:33:18 +02:00
Johan Walles
5313c02dd6 Simplify line rendering more 2023-10-10 21:26:43 +02:00
Johan Walles
dff0774141 Simplify line rendering 2023-10-10 21:14:36 +02:00
Johan Walles
99de54c510 Pass another mutation test 2023-10-10 20:46:53 +02:00
Johan Walles
8478883821 Test another corner case
It worked!
2023-10-10 06:18:03 +02:00
Johan Walles
a082fe207e Use the correct style for the trailer 2023-10-10 06:16:09 +02:00
Johan Walles
59a636205a Add trailing whitespace test
Failing.
2023-10-10 06:01:49 +02:00
Johan Walles
d7c104e80a Be smarter about line endings
Doesn't help Kitty though, don't know why.
2023-10-09 19:52:01 +02:00
Johan Walles
cd95996e8e Shortcut common style changes 2023-10-09 19:45:43 +02:00