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

stack ghci probably shouldn't change the code page #757

Closed
ndmitchell opened this issue Aug 11, 2015 · 21 comments
Closed

stack ghci probably shouldn't change the code page #757

ndmitchell opened this issue Aug 11, 2015 · 21 comments

Comments

@ndmitchell
Copy link
Contributor

On Windows, if I run stack ghci, when I get errors I see:

<interactive>:2:53:
    Not in scope: ‘main’
    Perhaps you meant ‘min’ (imported from Prelude)

If stack ghci on Windows is changing the codepage to something the console very definitely doesn't support, and as a result, it looks terrible. Without stack in the way I get:

<interactive>:2:1:
    Not in scope: `main'

I would be entirely happy without any smart quotes, but garbling the text nearby is a little unfortunate.

@snoyberg
Copy link
Contributor

Would you be able to take a crack at the codepage stuff? This is an area I have virtually no experience with, and I haven't been able to reproduce these problems since both consoles I've tried seem to support utf8 just fine

@ndmitchell
Copy link
Contributor Author

I don't have much time at the moment. I'm only taking such an active interest in stack all of a sudden because cabal decided to eat itself at a bad time :). This is a minor annoyance, and one I can ignore reasonably easily.

I'm just on the standard Windows 8.1 cmd prompt. You change the codepage to call GHC to dump some information? Do you have an example somewhere of which thing goes wrong without changing the code page.

@snoyberg
Copy link
Contributor

Using the standard cmd on Windows 10:

untitled

It's theoretically possible that this is because I've installed Hebrew support, but I really have no idea why my cmd prompt works in this case and yours doesn't. Regarding reproducing problems: https://ghc.haskell.org/trac/ghc/ticket/10762 gives some solid repros for the bugs we were encountering. Note that -ddump-hi is necessary in stack in order to detect files missing from the .cabal file.

@ndmitchell
Copy link
Contributor Author

I'll be upgrading to Windows 10 when things calm down, so maybe its fixed there. If there is a Win 8.1 only bug it's a lot less important.

@ndmitchell
Copy link
Contributor Author

BTW, why not use -M to generate a Makefile for the project? That seems much faster and easier than dumping all the hi files and will give you the same information.

@snoyberg
Copy link
Contributor

It doesn't; the hi dump includes the TH dependencies, and is generated as part of the normal build process. I'd be surprised if generating the Makefile as a separate step is faster than that, plus we'd have to write a significantly more complicated parser.

@snoyberg snoyberg added this to the 0.2.0.0 milestone Aug 11, 2015
@iharh
Copy link

iharh commented Aug 13, 2015

Michael, which font do you use at the screenshot from Win-10?

@snoyberg
Copy link
Contributor

Consolas

@iharh
Copy link

iharh commented Aug 13, 2015

Thanx. Probably I need to upgrade to Win-10 at some point. At my current Win-7 Consolas looks really ugly.
BTW, are you using ClearType or some additional effects?

@snoyberg
Copy link
Contributor

Shrug, no idea. I haven't tweaked things much.

On Thu, Aug 13, 2015, 9:12 AM Ihar Hancharenka [email protected]
wrote:

Thanx. Probably I need to upgrade to Win-10 at some point. At my current
Win-7 Consolas looks really ugly.
BTW, are you using ClearType or some additional effects?


Reply to this email directly or view it on GitHub
#757 (comment)
.

@iharh
Copy link

iharh commented Aug 13, 2015

BTW, At my Win-8 laptop Consolas is also much nicer. A also haven't tweaked it at all :)

@3noch
Copy link
Member

3noch commented Aug 13, 2015

I've had hit-and-miss experiences with this code-page stuff. Windows 10 console seems to support it well enough, but Console2 (a popular console replacement) doesn't like it at all. I wonder if it would be best to offer some sort of local (and even global) setting to disable this feature.

@ndmitchell
Copy link
Contributor Author

With Win10 I don't have any problems, the characters display properly, so my initial concern is no longer a problem.

@3noch
Copy link
Member

3noch commented Aug 14, 2015

I think Win10 will be a minority for a while still.

@ndmitchell
Copy link
Contributor Author

Trying it again after a stack upgrade --git shows it doesn't work, so I may have been using a stale stack on the path when I reported the codepage didn't break it. Now, with vanilla Windows 10, stack ghci shows garbage characters.

@snoyberg
Copy link
Contributor

I've just pushed a commit to master which does the following:

  • Code page changing only applies to the build command
  • Adds a command line parameter for controlling what happens with the code page

@ndmitchell
Copy link
Contributor Author

Confirmed that fixes my issue with ghci.

@snoyberg
Copy link
Contributor

Cool, closing.

@lukexi
Copy link
Contributor

lukexi commented Oct 3, 2015

Using Cmder (http://cmder.net/) and MSYS2, I seem to need to pass the --no-modify-code-page option to get correct output. Is this something I can put in my global config.yaml?

@borsboom
Copy link
Contributor

borsboom commented Oct 3, 2015

@lukexi Not currently. You might want to comment in #846 where we are planning to generally add many command-line arguments to the config file.

@lukexi
Copy link
Contributor

lukexi commented Oct 4, 2015

Thanks Emanuel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants