Skip to content

With multiple windows open, --reuse-window picks the wrong one #2492

Closed
@danopia

Description

@danopia

Hello, I am using the feature from #164 added in v3.5.0 to allow opening files into existing code-server windows from the code-server terminal.

Unfortunately, it seems as though the feature always uses a 'first' window as the target. If multiple windows are opened from the same code-server, presumably to different workspaces, the command opens the file in the 'wrong' window. As shown here:

  1. First invocation is for a file in workspace (via absolute path): opens in this first window, and the file is also selected in file tree
  2. Second invocation is for a different file in a second workspace: still opens in the first window, and now the file is also not in that file tree to be selected.

The second invocation should instead be opening code-server in the second window.

code-server.multiple.window.reuse.mp4

Additionally, I've noticed that closing the first window breaks the command completely in the second window:

> code-server --reuse-window ./README.md
[2020-12-19T13:45:57.339Z] error got error from VS Code {"error":{"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"/tmp/vscode-ipc-b4540ccb-b7ea-45e0-b7fb-c86c9a6dfb54.sock"}}

# there's other sockets still...
> ls -l /tmp/vscode-ipc-*
srwxr-xr-x. 1 abc abc 0 Dec 19 13:32 /tmp/vscode-ipc-03009dc7-38f2-434b-8ae6-4d015c338115.sock=
srwxr-xr-x. 1 abc abc 0 Dec 19 14:27 /tmp/vscode-ipc-49e3d80a-572c-4b96-a127-bd1fa8241dd7.sock=
srwxr-xr-x. 1 abc abc 0 Dec 19 14:46 /tmp/vscode-ipc-6ffdbe22-5221-437c-a9c4-385c72f46991.sock=

So it seems more that the code-server command is only working with one window's socket overall.

  • Web Browser: Google Chrome | 87.0.4280.109 (Official Build) (64-bit)
  • Local OS: Chromebook, as above
  • Remote OS: Ubuntu 18.04.5 LTS (docker image from linux-server/code-server)
  • Remote Architecture: Linux 5.7.16-200.fc32.x86_64 terminal becomes unresponsive after socket disconnect #1 SMP Wed Aug 19 16:58:53 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • code-server --version: 3.8.0 c4610f7

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions