zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
45.71k stars 2.52k forks source link

Github Copilot CLI - Error: could not prompt: unexpected escape sequence from terminal: ['\x1b' ']'] #9742

Open coolemur opened 5 months ago

coolemur commented 5 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Getting error Error: could not prompt: unexpected escape sequence from terminal: ['\x1b' ']'] when executing command gh copilot suggest "create a directory"

Steps to reproduce:

Environment

macOS: 14.4 (23E214)

Terminal: xterm-256color -zsh

Tried same steps in Mac native terminal & in iterm2 terminal - using same xterm-256color -zsh - that worked. It only fails in Zed terminal.

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

shbfy commented 5 months ago

+1

R-Rudolf commented 4 months ago

I received the same error message, but only if I use screen (4.9.0-1) in vscode (1.88.1). If I use screen in another termina GUI it does not happen. If I use without screen, or with tmux, it does not happen. I removed my complete .screenrc file and the behaviour is the same. 🤷‍♀️

It even dumps strange characters as well. Overall experience:

$ gh copilot explain tmux
^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\
Welcome to GitHub Copilot in the CLI!
version 1.0.1 (2024-03-22)

I'm powered by AI, so surprises and mistakes are possible. Make sure to verify any generated code or suggestions, and share feedback so that we can learn and improve. For more information, see https://gh.io/gh-copilot-transparency

^[[20;1R^[[20;1R^[[20;1RExplanation:                                                                                                                                                    

  tmux is a terminal multiplexer that allows you to create and manage multiple terminal sessions within a single window. It provides features such as splitting the window into panes,
  detaching and reattaching sessions, and running commands in the background.

^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\^[]11;rgb:f8f8/f8f8/f8f8^[\(.venv) user0@machine (main) ~/Repos >
$ 1R11;rgb:f8f8/f8f8/f8f811;rgb:f8f8/f8f8/f8f811;rgb:f8f8/f8f8/f8f81R1R1R11;rgb:f8f8/f8f8/f8f811;rgb:f8f8/f8f8/f8f811;rgb:f8f8/f8f8/f8f8
christian-gama commented 3 months ago

I'm getting this error too only in Zed's terminal (using fish). image

When I run the same command outside zed (using kitty + fish), this error does not happen. image