zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.19k stars 643 forks source link

Cannot use zellij in VScode Integrated terminal #1740

Open Kushagra-0801 opened 2 years ago

Kushagra-0801 commented 2 years ago

Basic information

zellij --version: 0.31.4 stty size: 29 147 uname -av or ver(Windows): Linux fa061866 5.14.0-1045-oem https://github.com/zellij-org/zellij/issues/51-Ubuntu SMP Mon Jul 4 06:41:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

List of programs interacted with: VScode 1.71.2 installed with snap on ubuntu 22.04.1

Further information

  1. Open a zellij session in the Integrated Terminal.

  2. Observe as it becomes unresponsive and fills up with weird escape codes.

  3. Open a zellij session in one terminal window.

  4. Attach to the same session in VScode integrated terminal.

  5. All terminals becomes unresponsive and starts filling up with weird escape codes.

  6. Ctrl-Q works on gnome terminal but it only stops the weird character output in vscode terminal.

syepes commented 2 years ago

+1

nikhil-prabhu commented 2 years ago

It seems to be working fine for me. Tested using zellij version 0.31.4 and vscode version 1.71.2 from the official Microsoft repository (on openSUSE Tumbleweed 20220912).

The only thing that isn't working for me in the vscode integrated terminal is Alt + directional keys for switching between panes. Alt + hjkl still works, though.

raphCode commented 2 years ago

When weird escape codes are produced directly after client startup, these could be related to our sixel support: We query the terminal emulator for sixel support and its color palette (If I remember correctly).

This maybe indicates that the vscode terminal emulator wrongly indicates sixel support but then can't parse or respond to the escape sequences for the color palette?

Kushagra-0801 commented 2 years ago

Please see the attached screencast to see what kind of weird output I am seeing.

Screencast from 28-09-22 03:02:13 PM IST.webm

raphCode commented 2 years ago

This actually looks like a different problem to me: The terminal responds correctly to our color palette queries but too slow / too late. I believe the terminal emulator runs in javascript, so this seems possible on slow machines. Could also explain why it works for some users.

We use a timeout to block input after startup, in the hopes that the color palette is parsed until that. The result is that the terminal emulator responds with escape codes after our timeout, which causes them to be typed inside the shell prompt.

@imsnif Does this make sense to you?

@Kushagra-0801 If you wait for the escape code garbage to end, and then press Ctrl-C to clear the shell prompt, can you use zellij normally afterwards?

Kushagra-0801 commented 2 years ago

Woah. I had never thought to just wait for it to end. I always thought it would keep going and going and killed the terminal directly. Anyways, yes. Waiting for it to end worked. I was able to clear the screen afterwards and use it normally.

The keybindings are going to be an issue though, as VS Code uses many of the same keybinds. If you use zellij in vscode, could you tell me what config you use (for vscode or zellij)?

taqtiqa-mark commented 1 year ago

@raphCode is there a way to change the timeout? We are seeing the same issue on every start.

imsnif commented 1 year ago

I think a good feature to add would be to have a flag that removes this behaviour (querying the terminal emulator). The effects would mainly be noticeable in applications that rely on very specific colors or cursor pixel ratios.