remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.21k stars 1.72k forks source link

tty.isatty returns false in the new version on nodemon #284

Closed simonexmachina closed 10 years ago

simonexmachina commented 10 years ago

The debug module uses tty.isatty(2) to choose whether to print coloured output. In the 1.0 version of nodemon this returns false.

remy commented 10 years ago

Can you provide an example on how to replicate this (so that I can build a test around it)

On Tuesday, January 28, 2014, Simon Wade notifications@github.com wrote:

The debug module uses tty.isatty(2) to choose whether to print coloured output. In the 1.0 version of nodemon this returns false.

Reply to this email directly or view it on GitHubhttps://github.com/remy/nodemon/issues/284 .

-- Remy

simonexmachina commented 10 years ago

Sure: https://gist.github.com/aexmachina/8677808

The problem comes from the call to var isatty = tty.isatty(2); returning false when run using nodemon.

remy commented 10 years ago

Sorry, catching up on this old issue. When I use your gist as the example, I don't see any output (not with running node index.js either).

Am I missing something?

simonexmachina commented 10 years ago

Ah yes, good point! You'd need to set the DEBUG environment variable: DEBUG=foo node index.js

remy commented 10 years ago

Is this still a problem with the latest? I'm seeing the colour work (on my Mac).

– Remy On 4 Jun 2014 14:26, "Simon Wade" notifications@github.com wrote:

Ah yes, good point! You'd need to set the DEBUG environment variable: DEBUG=foo node index.js

— Reply to this email directly or view it on GitHub https://github.com/remy/nodemon/issues/284#issuecomment-45089726.

simonexmachina commented 10 years ago

Yes, you're right. This is already fixed! Thanks Remy.

MehdiSaffar commented 4 years ago

I am using nodemon 2.0.3 and I am trying to refresh a CLI tool I am building on changes. I am using PyInquirer for interactive console prompt. Launching the script with python causes no problems while launching with nodemon causes

[nodemon] 2.0.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: py,json
[nodemon] starting `python ./try.py`
Traceback (most recent call last):
  File "./try.py", line 52, in <module>
    prompt(questions)
  File "/home/user/anaconda3/envs/ox/lib/python3.8/site-packages/PyInquirer/prompt.py", line 69, in prompt
    answer = run_application(
  File "/home/user/anaconda3/envs/ox/lib/python3.8/site-packages/prompt_toolkit/shortcuts.py", line 573, in run_application
    cli = CommandLineInterface(
  File "/home/user/anaconda3/envs/ox/lib/python3.8/site-packages/prompt_toolkit/interface.py", line 81, in __init__
    self.input = input or StdinInput(sys.stdin)
  File "/home/user/anaconda3/envs/ox/lib/python3.8/site-packages/prompt_toolkit/input.py", line 67, in __init__
    assert self.stdin.isatty()
AssertionError
[nodemon] app crashed - waiting for file changes before starting...

any idea how to solve this?