Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAQ/Common issues #60

Closed
PPKFS opened this issue Jul 16, 2022 · 3 comments
Closed

FAQ/Common issues #60

PPKFS opened this issue Jul 16, 2022 · 3 comments

Comments

@PPKFS
Copy link

PPKFS commented Jul 16, 2022

This is mostly a case of me spending 3 hours trying to work out why some things weren't working, and diving into brick and vty to no avail and discovering that the problem was silly little things on my end -- but I couldn't find any mention of them online anywhere. I wonder if they are worth documenting somewhere to ensure nobody does the same things as me, but gives up trying to get sandwich working.

Namely:

  • cabal test --test-options=--tui does now work, but it will cut off the tui at 80 columns.
  • when using terminalUICustomExceptionFormatters, it will be ignored if you use runSandwichWithCommandLineArgs and --tui.
@thomasjm
Copy link
Collaborator

Sorry to hear about that, definitely open to improving the documentation!

cabal test --test-options=--tui does now work, but it will cut off the tui at 80 columns.

FWIW, whenever I work with the TUI I do it by running the actual executable. I.e. using stack run instead of stack test, since the latter doesn't allocate a TTY. Not sure off the top of my head how that translates to cabal. I'm a little surprised you got it to work with cabal test. Agreed this should be very prominent in the documentation. At some point I'd like to open PRs against stack and cabal so that stack/cabal test can start up a TUI app seamlessly.

when using terminalUICustomExceptionFormatters, it will be ignored if you use runSandwichWithCommandLineArgs and --tui.

Ah, that would be a bug. We should forward any terminalUICustomExceptionFormatters in that case. Just opened #61.

@PPKFS
Copy link
Author

PPKFS commented Jul 16, 2022

I remembered seeing the issues about it not working through stack/cabal so I too was quite surprised when it 'worked' with cabal test. I'm guessing cabal has some virtual terminal, but it truncates it to 80 columns wide. cabal run foo-test works flawlessly though!

@thomasjm
Copy link
Collaborator

The TUI works with stack test now as of 2.9.3.

Things work with Cabal if you invoke the tests using cabal run, or if you set test-show-details: direct. (The latter should become the default in an upcoming version of Cabal; see haskell/cabal#7817). Some more discussion around that is here: haskell/cabal#8604.

The terminalUICustomExceptionFormatters issue is tracked in #61 so I think this issue can be closed!

thomasjm added a commit that referenced this issue Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants