Skip to content

Indestructible IDE Connections (No disconnects when you re-open laptop) #18101

Open
5 of 5 issues completed
Open

Description

@bpmct

One of the largest pain points with remote development is re-opening your laptop and having the IDE session disconnected with all of your state being droped.

@hugodutka has been dogfooding https://eternalterminal.dev/ with Coder (with some extra steps and precise config) over the last 2 weeks and it has been bulletproof. You can walk to a cafe, open your laptop, and the connection is instantly there. This also required Coder Desktop to run

We can reinvent some features from eternal terminal both on the coder agent and the local CLI to give users this experience natively.

Things to understand

  • How can we ensure activity reporting is properly being sent to Coder? (e.g. if the client is truly offline, lets be sure not to pass activity to Coder)
  • Do we need to require Coder Desktop for this? (OK if so)

Sub-issues

Sub-issues

5 of 5 Issues completed
Loading 5 sub-issues

Activity

  1. added theissue type on May 29, 2025
  2. changed the issue type fromtoon May 29, 2025
  3. hugodutka commented on May 29, 2025

    @hugodutka
    Collaborator

    Here's the setup I've been using:

    1. Eternal Terminal (ET) server running in workspace on port 2022
    2. OpenSSH server running in workspace on port 2244
    3. Coder Desktop running on laptop
    4. ET client running on laptop connected to the workspace's ET server, forwarding workspace:2244 (provided by Coder Desktop) to localhost:2244. Command: et -x -N -t 2244:2244 workspace.coder:2022
    5. SSH config entry on the laptop for the indestructible connection:
      Host et-workspace-coder
          HostName localhost
          User coder
          IdentityFile ~/.ssh/id_ed25519
          Port 2244
      
          # https://github.com/microsoft/vscode-remote-release/issues/1790#issuecomment-1803762302
          # based on https://github.com/microsoft/vscode-remote-release/issues/3096#issuecomment-1803750513
          ServerAliveInterval 60
          ServerAliveCountMax 4320
      
    6. ClientAliveInterval in the server sshd config set to 0 (that's the default)

    An ssh connection to et-workspace-coder will persist over network changes, laptop sleeps, etc. The TCP connection is proxied by ET so it never drops, and the ServerAliveInterval, ServerAliveCountMax, and ClientAliveInterval values ensure SSH doesn't disconnect when there's no activity. Importantly, this works for Remote SSH in VSCode/Cursor - the IDE session never drops.

  4. changed the title [-]Indestructible SSH Connections (No disconnects when you re-open laptop)[/-] [+]Indestructible IDE Connections (No disconnects when you re-open laptop)[/+] on May 30, 2025
  5. MrPeacockNLB commented on Jun 3, 2025

    @MrPeacockNLB
    Contributor

    This sounds great! It is somehow annoying to wait until the connection has been recreated espacially if you have to close and open the lid quiet often.

  6. MrPeacockNLB commented on Jun 3, 2025

    @MrPeacockNLB
    Contributor

    @hugodutka we have to use coder --header-command to inject an access token for Azure AppProxy. Will this work too?

  7. hugodutka commented on Jun 3, 2025

    @hugodutka
    Collaborator

    @MrPeacockNLB The setup I described is only a PoC that demonstrates indestructible IDE connections are possible. We're working on improving the Coder networking stack so these persistent connections happen automatically. Once that's implemented, your current setup should work without any changes.

  8. removed their assignment
    on Jun 6, 2025
  9. ibetitsmike commented on Jun 18, 2025

    @ibetitsmike
    Collaborator
  10. self-assigned this
    on Jun 23, 2025
  11. bpmct commented on Jul 2, 2025

    @bpmct
    MemberAuthor

    We recently implemented #18673 which is a partial fix and should resolve many issues with reconnecting/re-opening laptop. Additionally, we're continuing to measure demand for a more resilient eternal-terminal-like solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions