zellij icon indicating copy to clipboard operation
zellij copied to clipboard

Cannot use zellij in VScode Integrated terminal

Open Kushagra-0801 opened this issue 1 year ago • 1 comments

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.

Kushagra-0801 avatar Sep 19 '22 05:09 Kushagra-0801

+1

syepes avatar Sep 19 '22 13:09 syepes

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.

nikhil-prabhu avatar Sep 27 '22 14:09 nikhil-prabhu

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?

raphCode avatar Sep 27 '22 16:09 raphCode

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

Kushagra-0801 avatar Sep 28 '22 09:09 Kushagra-0801

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?

raphCode avatar Sep 28 '22 10:09 raphCode

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)?

Kushagra-0801 avatar Sep 28 '22 10:09 Kushagra-0801