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

TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor) #84

Open
gultar opened this issue Jun 17, 2023 · 1 comment

Comments

@gultar
Copy link

gultar commented Jun 17, 2023

Hi! I keep getting the error shown below when running basic "ai" commands. Any idea what is might be? I'm running it on Windows 10, and Git bash. For some reason, it doesn't work on Powershell, but it does on cmd.exe

$ ai How do you declare a new route in a Flask server?

T  AI Shell
|
o  Your script:

powershell
write-host "To declare a new route in a Flask server, you can add the route decorator to a function definition within the Flask app instance, like this: @app.route('/new_route')" -ForegroundColor Green


•
|
o  Explanation:

1. Initializes a PowerShell script.
2. Prints a message using the "write-host" command.
3. The message describes how to declare a new route in a Flask server by using the "@app.route('/new_route')" decorator.
4. The message is displayed in green text using the "-ForegroundColor" parameter.

•

✖ TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)
    at new SystemError (node:internal/errors:250:5)
    at new NodeError (node:internal/errors:361:7)
    at new WriteStream (node:tty:93:11)
    at ED.prompt (file:///C:/Users/sacha/AppData/Roaming/npm/node_modules/@builder.io/ai-shell/node_modules/@clack/core/dist/index.mjs:9:693)
    at Module.ee (file:///C:/Users/sacha/AppData/Roaming/npm/node_modules/@builder.io/ai-shell/node_modules/@clack/prompts/dist/index.mjs:28:7)
    at runOrReviseFlow (file:///C:/Users/sacha/AppData/Roaming/npm/node_modules/@builder.io/ai-shell/dist/cli.mjs:1736:26)
    at prompt (file:///C:/Users/sacha/AppData/Roaming/npm/node_modules/@builder.io/ai-shell/dist/cli.mjs:1732:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

    ai-shell v1.0.1

    Please open a Bug report with the information above:
    https://github.com/BuilderIO/ai-shell/issues/new
@Ra3d0r
Copy link

Ra3d0r commented Jun 21, 2023

I encountered the same problem, showed the same error. Only runs ai-shell in cmd, but bash and PowerShell give an error.

However, everything worked in bash in VScode, so I decided to update the git version along with bash. I had a version of Git for Windows v2.36.1 and I updated it via PowerShell to the latest v2.41.0.

I updated using the command in PowerShell:
git update-git-for-windows

Now ai-shell works in the bash terminal separately from VScode.

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

No branches or pull requests

2 participants