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

Disabling terminal clearning and "All good at time t" #184

Closed
moll opened this Issue Jul 23, 2018 · 10 comments

Comments

Projects
None yet
2 participants
@moll

moll commented Jul 23, 2018

Hey,

Is there a way to disable the behavior of outputting "All good at time t" at the top (by outputting blank lines) every second? Aside from liking/desiring to refer to past errors, it really makes GNOME's poor terminal (/usr/bin/gnome-shell) use 20%+ of CPU just to move things around in my long scrollback buffer every second.

This is with GHCId v0.7. I initially thought --no-status would do the trick, but unfortunately not.

Thanks in advance!

@ndmitchell

This comment has been minimized.

Owner

ndmitchell commented Jul 23, 2018

If it's reloading every second even when you aren't editing then there's a bug. Can you run with --verbose and send me the output.

@moll

This comment has been minimized.

moll commented Jul 23, 2018

Hey,

Thanks for the quick response.

In a one-file test project, here's what I see.

$ ghcid --verbose -c "cabal repl"
Loading cabal repl ...
%STDOUT: Preprocessing executable 'stdin' for stdin-0.1.337..
%STDOUT2: Preprocessing executable 'stdin' for stdin-0.1.337..
Preprocessing executable 'stdin' for stdin-0.1.337..
%STDOUT: GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help
%STDOUT2: GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help
%STDIN: import qualified System.IO as INTERNAL_GHCID
%STDIN: :set prompt #~GHCID-START~#
%STDIN: :set -fno-break-on-exception
%STDIN: :set -fno-break-on-error
%STDIN: :set -v1
%STDIN: :set -fno-hide-source-paths
%STDIN: INTERNAL_GHCID.putStrLn ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','1','~','#']
INTERNAL_GHCID.hPutStrLn INTERNAL_GHCID.stderr ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','1','~','#']
GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help
%STDOUT: Loaded GHCi configuration from /home/user/.rc.d/ghci
%STDOUT2: Loaded GHCi configuration from /home/user/.rc.d/ghci
Loaded GHCi configuration from /home/user/.rc.d/ghci
%STDOUT: [1 of 1] Compiling Main             ( bin/stdin.hs, interpreted )
%STDOUT2: [1 of 1] Compiling Main             ( bin/stdin.hs, interpreted )
[1 of 1] Compiling Main             ( bin/stdin.hs, interpreted )
%STDOUT: Ok, one module loaded.
%STDOUT2: Ok, one module loaded.
Ok, one module loaded.
%STDOUT: *Main> *Main> *Main INTERNAL_GHCID> #~GHCID-START~##~GHCID-START~##~GHCID-START~##~GHCID-START~##~GHCID-START~##~GHCID-FINISH-1~#
%STDERR: #~GHCID-FINISH-1~#
%STDIN: 
%STDIN: INTERNAL_GHCID.putStrLn ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','2','~','#']
INTERNAL_GHCID.hPutStrLn INTERNAL_GHCID.stderr ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','2','~','#']
%STDOUT: it :: ()
it :: ()
%STDOUT: #~GHCID-START~#it :: ()
it :: ()
%STDOUT: #~GHCID-START~##~GHCID-START~##~GHCID-FINISH-2~#
%STDERR: #~GHCID-FINISH-2~#
%STDIN: :set -ferror-spans
:set -j
:set -fdiagnostics-color=always

%STDIN: INTERNAL_GHCID.putStrLn ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','3','~','#']
INTERNAL_GHCID.hPutStrLn INTERNAL_GHCID.stderr ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','3','~','#']
%STDOUT: it :: ()
%STDOUT: #~GHCID-START~#it :: ()
%STDOUT: #~GHCID-START~##~GHCID-START~##~GHCID-START~##~GHCID-START~##~GHCID-START~##~GHCID-FINISH-3~#
%STDERR: #~GHCID-FINISH-3~#
%STDIN: :show paths
%STDIN: INTERNAL_GHCID.putStrLn ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','4','~','#']
INTERNAL_GHCID.hPutStrLn INTERNAL_GHCID.stderr ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','4','~','#']
%STDOUT: it :: ()
%STDOUT: #~GHCID-START~#it :: ()
%STDOUT: #~GHCID-START~#current working directory: 
%STDOUT:   /home/user/Documents/stdin
%STDOUT: module import search paths:
%STDOUT:   dist/build/stdin/stdin-tmp
%STDOUT:   .
%STDOUT:   dist/build/stdin/autogen
%STDOUT:   dist/build/global-autogen
%STDOUT: #~GHCID-START~##~GHCID-FINISH-4~#
%STDERR: #~GHCID-FINISH-4~#
%MESSAGES: [LoadConfig {loadFile = "/home/user/.rc.d/ghci"},Loading {loadModule = "Main", loadFile = "it :: ()/bin/stdin.hs"}]
%LOADED: ["it :: ()/bin/stdin.hs"]

All good (1 module, at 14:47:56)


%WAITING: /home/user/Documents/stdin/.ghcid /home/user/.rc.d/ghci it :: ()/bin/stdin.hs
%RELOADING: Error when waiting, if this happens repeatedly, raise a ghcid bug. "/home/user/Documents/stdin/it :: ()/bin/": can't watch what isn't there!: does not exist

Reloading...
  Error when waiting, if this happens repeatedly, raise a ghcid bug.
  "/home/user/Documents/stdin/it :: ()/bin/": can't watch what isn't there!: does not exist

%STDIN: :reload
%STDIN: INTERNAL_GHCID.putStrLn ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','5','~','#']
INTERNAL_GHCID.hPutStrLn INTERNAL_GHCID.stderr ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','5','~','#']
%STDOUT: it :: ()
%STDOUT: #~GHCID-START~#it :: ()
%STDOUT: #~GHCID-START~#Ok, one module loaded.
%STDOUT: #~GHCID-START~##~GHCID-FINISH-5~#
%STDERR: #~GHCID-FINISH-5~#
%STDIN: :show modules
%STDIN: INTERNAL_GHCID.putStrLn ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','6','~','#']
INTERNAL_GHCID.hPutStrLn INTERNAL_GHCID.stderr ['#','~','G','H','C','I','D','-','F','I','N','I','S','H','-','6','~','#']
%STDOUT: it :: ()
%STDOUT: #~GHCID-START~#it :: ()
%STDOUT: #~GHCID-START~#Main             ( bin/stdin.hs, interpreted )
%STDOUT: #~GHCID-START~##~GHCID-FINISH-6~#
%STDERR: #~GHCID-FINISH-6~#
%MESSAGES: []
%LOADED: ["it :: ()/bin/stdin.hs"]

All good (1 module, at 14:47:57)

%WAITING: /home/user/Documents/stdin/.ghcid /home/user/.rc.d/ghci it :: ()/bin/stdin.hs
%RELOADING: Error when waiting, if this happens repeatedly, raise a ghcid bug. "/home/user/Documents/Haskell Cookbook/stdin/it :: ()/bin/": can't watch what isn't there!: does not exist

Reloading...
  Error when waiting, if this happens repeatedly, raise a ghcid bug.
  "/home/user/Documents/stdin/it :: ()/bin/": can't watch what isn't there!: does not exist

Could this be somehow related hs-source-dirs: .? Or ~/.ghci being a symlink? Or the trailing slash in ()/bin/": can't watch what isn't there!: does not exist?

This is on a Linux system.

@ndmitchell

This comment has been minimized.

Owner

ndmitchell commented Aug 22, 2018

The it :: () is upsetting ghcid. My guess is you have something in your .ghci that enables that. Can you share your .ghci? Should be easy to parse around it, but I'd like to reproduce and add a test.

@moll

This comment has been minimized.

moll commented Aug 23, 2018

I don't have a per-project .ghci, but I do have one at ~/.ghci with the following content:

-- Automatically display the type of the return value.
:set +t
:set -fghci-hist-size=1000

-- :set prompt "> "

What does it :: () stand for? Something ghci prints out when its invoked?

@moll

This comment has been minimized.

moll commented Aug 23, 2018

Ah, could that be ghcid passing commands to ghci and ghci showing their types as I've configured through :set +t?

@ndmitchell

This comment has been minimized.

Owner

ndmitchell commented Aug 26, 2018

Yes, almost certainly. I'll make ghcid pass :set -t to ghci to override it.

@moll

This comment has been minimized.

moll commented Aug 26, 2018

Wouldn't loading ghci ignoring its .ghcirc be a more sustainable solution? I don't remember whether ghcid actually had a CLI for anyone to care about their ghci configuration as I only use it for running tests.

@ndmitchell

This comment has been minimized.

Owner

ndmitchell commented Aug 26, 2018

What if your global .ghci points at an include path that is required? Loading from local .ghci files is almost essential. I prefer to take the system as it is and undo anything it doesn't like rather than try and set it up perfectly, which is a strategy that has worked remarkably well so far.

@ndmitchell

This comment has been minimized.

Owner

ndmitchell commented Sep 7, 2018

Done and released as 0.7.1. Let me know if it's still looping for you.

@ndmitchell ndmitchell closed this Sep 7, 2018

@moll

This comment has been minimized.

moll commented Sep 7, 2018

Thank you! I'll give it a try and ping back if it's not working.

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