Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

bash: console: command not found #22

Closed
murrayju opened this issue Jul 1, 2016 · 13 comments
Closed

bash: console: command not found #22

murrayju opened this issue Jul 1, 2016 · 13 comments

Comments

@murrayju
Copy link
Contributor

murrayju commented Jul 1, 2016

Seems like there is some dependency on something called console?

$ docker run -it ubuntu bash
the input device is not a TTY.  If you are using mintty, try prefixing the command with 'winpty'
-- babun-docker: Using winpty
bash: console: command not found
@tiangolo
Copy link
Owner

tiangolo commented Jul 1, 2016

Hmm, that's strange. I think Winpty updated its Cygwin (Babun) name to be winpty, but babun-docker should be using the last one named console...

I'll check it out and reply back.

@murrayju
Copy link
Contributor Author

murrayju commented Jul 1, 2016

Looks to me like console is a command that exists in zsh but not bash. I have weird issues with zsh and would prefer bash if possible.

@tiangolo
Copy link
Owner

tiangolo commented Jul 5, 2016

console is the (now old) version of winpty for Cygwin (Babun), it seems you were having issues with the winpty download. I'll update the Winpty version soon.

But I guess you figured it out with your PR #23, right?

Does that solve your issue (may I close it)?

@murrayju
Copy link
Contributor Author

murrayju commented Jul 5, 2016

No, #23 seems to be unrelated. After fixing #23 the install script succeeds, but there is something wrong with the $PATH such that it can't find console. Even though echo $PATH clearly shows :/home/me/.winpty on the end, running console doesn't work:

$ console
bash: console: command not found

Perhaps the script could use an explicit path to the console executable, instead of relying on the path?

@tiangolo
Copy link
Owner

tiangolo commented Jul 7, 2016

@murrayju After merging your PR I updated Winpty to the latest version. So the binary is now winpty instead of console.

I had the following issue: after installing babun-docker from the sources everything worked. But if I removed it completely and installed it from the network (with curl ...) although the $PATH showed /home/$USER/.winpty when I ran which winpty I had the same error. But if I restarted Babun after the installation it would work. Actually, if I sourced the setup.sh in the local file after installation (instead of with curl) it woud work. I'm still not sure why.

But I added a notification in the installation to run babun-docker-update right after installation, so that it sources that setup.sh automatically and then it works. I will update the README to include that to in the installation steps.

Coud you try that and let me know?

If that doesn't work, try:

  • remove everything: rm -rf ~/.winpty ~/.babun-docker
  • install again: curl -s https://raw.githubusercontent.com/tiangolo/babun-docker/master/setup.sh | source /dev/stdin
  • run the update: babun-docker-update and / or close Babun and open it up again
  • try again, with which winpty

@murrayju
Copy link
Contributor Author

murrayju commented Jul 8, 2016

Still isn't working. Here is what I tried:

  1. rm -rf ~/.winpty ~/.babun-docker

  2. curl -s https://raw.githubusercontent.com/tiangolo/babun-docker/master/setup.sh | source /dev/stdin

    WARNING: timestamping does nothing in combination with -O. See the manual
    for details.
    
    --2016-07-08 11:01:41--  https://github.com/rprichard/winpty/releases/download/0.4.0/winpty-0.4.0-cygwin-2.5.2-ia32.tar.gz
    Resolving github.com (github.com)... 192.30.253.113
    Connecting to github.com (github.com)|192.30.253.113|:443... connected.
    HTTP request sent, awaiting response...
    HTTP/1.1 302 Found
    Server: GitHub.com
    Date: Fri, 08 Jul 2016 15:01:42 GMT
    Content-Type: text/html; charset=utf-8
    Transfer-Encoding: chunked
    Status: 302 Found
    Cache-Control: no-cache
    Vary: X-PJAX
    Location: https://github-cloud.s3.amazonaws.com/releases/3829192/f61902c2-3d88-11e6-9d1a-0e439768392d.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160708%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160708T150142Z&X-Amz-Expires=300&X-Amz-Signature=2d2ff2123854166628b596df31e5fbab51c29759083080210879ab4705bcc6b2&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dwinpty-0.4.0-cygwin-2.5.2-ia32.tar.gz&response-content-type=application%2Foctet-stream
    X-UA-Compatible: IE=Edge,chrome=1
    Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Tue, 08 Jul 2036 15:01:42 -0000; secure; HttpOnly
    Set-Cookie: _gh_sess=eyJzZXNzaW9uX2lkIjoiNGU1ODM5YWNhMTkzOTcwNDUyYTcwNGEwOTg2MGE1MGUiLCJzcHlfcmVwbyI6InJwcmljaGFyZC93aW5wdHkiLCJzcHlfcmVwb19hdCI6MTQ2Nzk5MDEwMn0%3D--f1b04b16800f3c20108f0e121265a66bdce38b6c; path=/; secure; HttpOnly
    X-Request-Id: 590622b1dc18d73d6b74b596d281dd2c
    X-Runtime: 0.021253
    Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com api.github.com www.google-analytics.com github-cloud.s3.amazonaws.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com collector.githubapp.com *.gravatar.com *.wp.com *.githubusercontent.com; media-src 'none'; object-src assets-cdn.github.com; plugin-types application/x-shockwave-flash; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com
    Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
    Public-Key-Pins: max-age=5184000; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains
    X-Content-Type-Options: nosniff
    X-Frame-Options: deny
    X-XSS-Protection: 1; mode=block
    Vary: Accept-Encoding
    X-Served-By: f75e9d2841ba49dfdb3929780833971c
    X-GitHub-Request-Id: 49AE5F6E:65A8:D576E4D:577FC056
    Location: https://github-cloud.s3.amazonaws.com/releases/3829192/f61902c2-3d88-11e6-9d1a-0e439768392d.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160708%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160708T150142Z&X-Amz-Expires=300&X-Amz-Signature=2d2ff2123854166628b596df31e5fbab51c29759083080210879ab4705bcc6b2&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dwinpty-0.4.0-cygwin-2.5.2-ia32.tar.gz&response-content-type=application%2Foctet-stream [following]
    --2016-07-08 11:01:41--  https://github-cloud.s3.amazonaws.com/releases/3829192/f61902c2-3d88-11e6-9d1a-0e439768392d.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20160708%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20160708T150142Z&X-Amz-Expires=300&X-Amz-Signature=2d2ff2123854166628b596df31e5fbab51c29759083080210879ab4705bcc6b2&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dwinpty-0.4.0-cygwin-2.5.2-ia32.tar.gz&response-content-type=application%2Foctet-stream
    Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.98.64
    Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.98.64|:443... connected.
    HTTP request sent, awaiting response...
    HTTP/1.1 200 OK
    x-amz-id-2: kZ85cG5f5tdzO5T1E2ALZ1FVS3sl3dTLKsRW7bmkEFlWmYquH1hGK1TjQiO1dPpQ7Fqhu+UaLiQ=
    x-amz-request-id: FED59E33883B33DB
    Date: Fri, 08 Jul 2016 15:01:43 GMT
    Content-Disposition: attachment; filename=winpty-0.4.0-cygwin-2.5.2-ia32.tar.gz
    Last-Modified: Wed, 29 Jun 2016 04:35:14 GMT
    ETag: "bf3531e0e64510a07854dc8e1340919e"
    Accept-Ranges: bytes
    Content-Type: application/octet-stream
    Content-Length: 832292
    Server: AmazonS3
    Length: 832292 (813K) [application/octet-stream]
    Saving to: ‘winpty-0.4.0-cygwin-2.5.2-ia32.tar.gz’
    
    winpty-0.4.0-cygwin-2.5.2-ia32.tar.gz                                                      100%[=========================================================================================================================================================================================================================================>] 812.79K  2.38MB/s   in 0.3s
    
    2016-07-08 11:01:42 (2.38 MB/s) - ‘winpty-0.4.0-cygwin-2.5.2-ia32.tar.gz’ saved [832292/832292]
    
    -- babun-docker: to finish the installation please run: babun-docker-update
    Cloning into '/home/Justin/.babun-docker'...
    remote: Counting objects: 198, done.
    remote: Compressing objects: 100% (14/14), done.
    remote: Total 198 (delta 3), reused 0 (delta 0), pack-reused 183
    Receiving objects: 100% (198/198), 41.80 KiB | 0 bytes/s, done.
    Resolving deltas: 100% (64/64), done.
    Checking connectivity... done.
    -- babun-docker: to finish the installation please run: babun-docker-update
    
  3. babun-docker-update
    -- babun-docker: Updating babun-docker Already up-to-date.

  4. which winpty
    which: no winpty in (/home/Justin/bin:/home/Justin/bin:/home/Justin/bin:/usr/local/bin:/usr/bin:/home/Justin/.local/bin:/cygdrive/c/Program Files/ConEmu/ConEmu/Scripts:/cygdrive/c/Program Files/ConEmu:/cygdrive/c/Program Files/ConEmu/ConEmu:/cygdrive/c/Program Files/Docker/Docker/Resources/bin:/cygdrive/c/Applications/Atlassian/atlassian-plugin-sdk-5.1.1/bin:/cygdrive/c/Program Files (x86)/nant-0.92/bin:/cygdrive/c/Program Files (x86)/scala/bin:/cygdrive/c/Program Files (x86)/vim/vim74:/cygdrive/c/Program Files/Babel:/cygdrive/c/Program Files/Docker Toolbox:/cygdrive/c/Program Files/Java/jdk1.8.0_60/bin:/cygdrive/c/Program Files/Mercurial:/cygdrive/c/Program Files/TortoiseHg:/cygdrive/c/ProgramData/Oracle/Java/javapath:/cygdrive/c/ProgramData/chocolatey/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/system32:/cygdrive/c/bin/php:/cygdrive/c/program files/git/bin:/cygdrive/c/bin/python2:/cygdrive/c/HashiCorp/Vagrant/bin:/cygdrive/c/Program Files (x86)/Windows Kits/8.1/Windows Performance Toolk)/home/Justin/.winptyS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/nodejs:/cygdrive/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/cygdrive/c/Users/Justin/AppData/Roaming/npm:/cygdrive/c/Users/Justin/AppData/Local/atom/bin:/home/Justin/.winpty

  5. Closed and reopened babun

  6. which winpty gave the same output

  7. ls /home/Justin/.winpty
    winpty.dll winpty.exe winpty-0.4.0-cygwin-2.5.2-ia32.tar.gz winpty-agent.exe winpty-debugserver.exe

Clearly there is something wrong with my $PATH, it just flat out isn't working.

@tiangolo
Copy link
Owner

Hmm, strange, very strange.

Could you try the following?


Check the permissions of the files in the winpty dir:

ls -la ~/.winpty

Check if your terminal detects winpty.exe but not winpty:

which winpty.exe

Try to create a link in your home/bin directory:

ln -s ~/.winpty/winpty.exe ~/bin/winpty

Try to use the Zsh shell and see if it works with that one:

babun shell /bin/zsh

then restart Babun and run:

which winpty

@agur
Copy link

agur commented Sep 15, 2016

The solution for:

the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'

was simple for me. Stopped using git bash or git-sdk-64 shells, and just used the windows Docker Quickstart Terminal.

And I tried the winpty suggestion from here and other posts found online - but that didn't help.

@tiangolo
Copy link
Owner

@agur This is an issue for babun-docker, a program to allow using Docker in Babun (or Cygwin). It's apart from the Quickstart Termina, Git for Windows or any other MinGW based terminal.

@tiangolo
Copy link
Owner

@murrayju did you solve your problem? Should we close this issue?

@murrayju
Copy link
Contributor Author

I never really solved the problem, but have since moved to using Ubuntu as my primary os... Feel free to close this if you'd like, I probably won't troubleshoot further.

@tiangolo
Copy link
Owner

OK, thanks for replying back @murrayju .

And good choice, Ubuntu is also my main OS most of the time.

@rhino-corey
Copy link

I had this same problem, went through your troubleshooting steps, and it finally worked when I switched back to the zsh shell:

babun shell /bin/zsh
restart babun

Thanks!

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

No branches or pull requests

4 participants