2

For some time, I've been using Haskero on Windows 10 for Haskell programming, and it's been great for a long time. Recently, however, I repaved my laptop, and since then, the functionality that enables switching targets contains garbled output:

Switch-target UI

This isn't just a display issue. It effectively prevents me from being able to switch targets:

Spawning process 'stack' with command 'stack ghci --with-ghc intero "--ghci-options=-ignore-dot-ghci -Wall" --no-build --no-load RestaurantReservation:test:RestaurantReservation-test[0m'
[Error - 07:52:52] Change targets failed. Stopping Haskero for this target. Switch to another target or 'Default targets'.
Hint : try running a build command to get missing dependencies (> stack build RestaurantReservation:test:RestaurantReservation-test[0m)
Error details:

  Message: Request changeTargets failed unexpectedly without providing any details.
  Code: -32603 

Notice that when I try to switch to the test target, it issues a command to stack that includes those non-printable characters. Among other issues, this means that I get absolutely no value from the add-in for my unit tests.

The presence of those non-printable characters, as well as stty: 'standard input': Inappropriate ioctl for device looks to me like an issue with with how standard output is interpreted.

As far as I can tell, from perusing the Haskero code base, it looks as though the list of targets comes from stack ide targets. If, however, I issue this command on the command line, all looks good:

$ stack ide targets
RestaurantReservation:lib
RestaurantReservation:exe:RestaurantReservation
RestaurantReservation:test:RestaurantReservation-test

This used to work on Windows 10 before I repaved the machine, but now it doesn't.

Since it worked before re-installation, I'm hoping that there's some environment setting I can tweak to get the functionality back, but if there is, it's not clear to me what it'd be.

How do I make the targets dialogue use clean target names, so that switching among them is possible?

Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
  • 2
    I believe that these issues are due to a [recent update of `stack`](https://github.com/commercialhaskell/stack/releases/tag/v2.1.1). The `stty` message comes from [this issue](https://github.com/commercialhaskell/stack/issues/4901), which I am currently trying to fix. I’m not sure about the garbled outputs with `[`, but I was able to fix it by passing `--color=never` to Stack (although I use Emacs so this may not work for you). – bradrn Sep 04 '19 at 06:09
  • 1
    That `[m` stuff is the printable portion of the ansi escape code for setting the terminal color. There's a non-printable `ESC` character before the `[`, which is why they're called "escape codes". – Carl Sep 04 '19 at 06:20

0 Answers0