hledger icon indicating copy to clipboard operation
hledger copied to clipboard

Support brick-2 and vty-6.

Open amano-kenji opened this issue 1 year ago • 14 comments

brick-2 depends on vty-6 which introduces breaking changes.

From vty-6 onward, you have to depend on vty-crossplatform, vty-windows, or vty-unix for mkVty function.

If you don't use mkVty function, then you don't need to depend on one of platform-specific vty packages.

amano-kenji avatar Nov 16 '23 03:11 amano-kenji

I am working on this. In theory, this requires very minimal change in hledger-ui:

  • fix some imports (a couple of lines)
  • fix build conditions (delete a couple of lines)
  • add lower bounds for brick(/vty/vty-crossplatform, because stack snapshots do not have new versions yet (also a very local change).
  • add notepad as default editor on windows; git for windows does that, for example (diff is a couple of lines)
  • change CI scripts to release windows executable for hledger-ui. I haven't looked into that yet; I'll need some help with that

There is, however, a bug:

  • run hledger-ui
  • exit hledger-ui (q)
  • terminal no longer responds to mouse ⚠️ !

I'll see whether the bug is in hledger-ui, brick, or vty-windows (or in my setup 😢 ). I am not comfortable with pushing for windows availability of hledger-ui before fixing this bug.

ShrykeWindgrace avatar Nov 22 '23 14:11 ShrykeWindgrace

Wonderful ! I was thinking about this, thanks for working on it.

simonmichael avatar Nov 22 '23 18:11 simonmichael

(It will probably not get merged in master until stackage nightly gets brick 2.)

simonmichael avatar Nov 22 '23 18:11 simonmichael

I'm happy to handle the CI part.

simonmichael avatar Nov 22 '23 18:11 simonmichael

(Sorry for the stream of messages, last one:)

It's worth testing in as many windows terminal environments as you can find, we'll probably get different bug reports for each one.

simonmichael avatar Nov 22 '23 18:11 simonmichael

Did you try latest versions of vty and brick? The latest versions might have fixed the rendering issue.

amano-kenji avatar Nov 23 '23 03:11 amano-kenji

(Sorry for the stream of messages, last one:)

It's worth testing in as many windows terminal environments as you can find, we'll probably get different bug reports for each one.

I guess most of this bugreports will be safely redirected to vty/vty-windows in that case, with all being "ok, in that terminal emulator it almost works, except for that and that feature" =) We can explicitly mention that hledger-ui will be ok for Windows Terminal, ok-ish in ListOfTerminalEmulators, and most probably not ok in AnotherListOfTerminalEmulators.

ShrykeWindgrace avatar Nov 23 '23 09:11 ShrykeWindgrace

Did you try latest versions of vty and brick? The latest versions might have fixed the rendering issue.

Yes, I tested both master and latest releases. This is not a rendering issue, it is a "restore terminal to its prior state" issue.

ShrykeWindgrace avatar Nov 23 '23 09:11 ShrykeWindgrace

Well, for now the list of supported terminal emulators is a WIP, https://github.com/chhackett/vty-windows/wiki/TerminalSupport with latest info. The bug with terminal state is fixed, I'll open the PR in the next couple of days.

ShrykeWindgrace avatar Nov 27 '23 15:11 ShrykeWindgrace

could you move the thread on kitty to a separate issue?

Done, #2126.

Related to this issue, hledger-ui is now out of stackage nightly. I'm assuming supporting both old and new vty in the same release would be too much CPP and hassle (?), so getting back in to stackage will require a new release that supports and requires vty 6.1+ and brick 2.1.1+. Our 1.32.1 bugfix release is pending. But probably squeezing a big vty/brick upgrade into a bugfix release would be a bad idea.

simonmichael avatar Dec 07 '23 19:12 simonmichael

I might do a separate hledger-ui-1.32.1 release after this has landed and we have had some cross platform user testing. (Need to figure out simpler release process for individual packages..)

simonmichael avatar Dec 07 '23 19:12 simonmichael

Though, windows support is a feature worth shouting about, not a bugfix..

simonmichael avatar Dec 07 '23 19:12 simonmichael

Done, #2126.

Thank you!

On-topic: since we got vty-6, vty-crossplatform and brick-2 stackage, I'll prepare a PR with my changes.

Though, windows support is a feature worth shouting about, not a bugfix..

Indeed =)

ShrykeWindgrace avatar Dec 08 '23 13:12 ShrykeWindgrace

I'm waiting for brick 2.3 support because brick 2.3 has functions that I want.

amano-kenji avatar Jan 08 '24 02:01 amano-kenji

I think it can be closed now.

amano-kenji avatar Feb 23 '24 13:02 amano-kenji