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
Milestone

Comments

@ndmitchell
Copy link
Contributor

@ndmitchell ndmitchell commented Aug 11, 2015

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

@snoyberg snoyberg commented Aug 11, 2015

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

@ndmitchell ndmitchell commented Aug 11, 2015

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

@snoyberg snoyberg commented Aug 11, 2015

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

@ndmitchell ndmitchell commented Aug 11, 2015

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

@ndmitchell ndmitchell commented Aug 11, 2015

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

@snoyberg snoyberg commented Aug 11, 2015

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 iharh commented Aug 13, 2015

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

@snoyberg
Copy link
Contributor

@snoyberg snoyberg commented Aug 13, 2015

Consolas

@iharh
Copy link

@iharh 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

@snoyberg snoyberg commented Aug 13, 2015

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

On Thu, Aug 13, 2015, 9:12 AM Ihar Hancharenka notifications@github.com
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 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 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

@ndmitchell ndmitchell commented Aug 14, 2015

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 3noch commented Aug 14, 2015

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

@ndmitchell
Copy link
Contributor Author

@ndmitchell ndmitchell commented Aug 14, 2015

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 added a commit that referenced this issue Aug 16, 2015
@snoyberg
Copy link
Contributor

@snoyberg snoyberg commented Aug 16, 2015

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

@ndmitchell ndmitchell commented Aug 16, 2015

Confirmed that fixes my issue with ghci.

@snoyberg
Copy link
Contributor

@snoyberg snoyberg commented Aug 16, 2015

Cool, closing.

@snoyberg snoyberg closed this Aug 16, 2015
@lukexi
Copy link
Contributor

@lukexi 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 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 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.