Notice

I migrated back to VSCode. Sadly, the tools needed for remote cloud development is brittle for other plugins. Open-Remote SSH works pretty well for both VSCode and VSCodium over SSH option for GitHub Codespaces and Gitpod. The only issue is other plugins are not having the same result and I don’t want to debug something that’s not consistent between environments. Installing SQLite3 Editor for Gitpod was the final straw and I think in the future I won’t recommend Gitpod because of that. GitHub Codespaces don’t have an option to connect SSH directly. Instead, you have to resort using VSCode or GitHub CLI https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli#ssh-into-a-codespace --- which I am not interested of doing weird workarounds on VSCodium such as generating the SSH key by “connecting” and then getting the config on VSCodium since that defeats the purpose of using VSCodium because of another heavy reliance of GitHub’s tooling.

VSCodium, a non-telemetry fork of VSCode, has a flatpak. I already have a post about in the archive.

However, I left out some tips to make sure it works seamlessly. Other stuff are just notes.

Using SSH in Flatpak-Spawn

Recently, I was trying to pull my hair out trying to understand why atuin is not working for me from a flatpak-spawned Zsh. The error was invoked around these lines of code in atuin. It’s not atuin’s fault. It was caused by a very old issue in flatpak.

Seems it cannot check for the addresses of the ioctl (?) or whatever jargon. But whatever that is, the solution was pretty straight-forward.

I just added the following to my User Settings in JSON

{
  "terminal.integrated.defaultProfile.linux": "zsh",
  "terminal.integrated.profiles.linux": {
    "zsh": {
      "path": "/usr/bin/flatpak-spawn",
      "args": ["--host", "--env=TERM=xterm-256color", "ssh", "localhost"]
    }
  }
}

Tbh, I will just rename it to ssh or localhost. It also works for containers running ssh inside too. For example, localhost is the host system. tumbleweed is the podman container.

{
  "terminal.integrated.profiles.linux": {
    "localhost": {
      "path": "/usr/bin/flatpak-spawn",
      "args": ["--host", "--env=TERM=xterm-256color", "ssh", "localhost"]
    },
    "tumbleweed": {
      "path": "/usr/bin/flatpak-spawn",
      "args": ["--host", "--env=TERM=xterm-256color", "ssh", "tumbleweed"]
    }
  }
}

Caveats is it will ask a passphrase but that’s not going to stop me tbh.

UPDATE (this section is now obsolete. New best fix below)

The new fix was to install host-spawn.

"terminal.integrated.profiles.linux": {
      "localhost": {
          "path": "/usr/bin/flatpak-spawn",
          "args": [
              "--host",
              "--env=TERM=xterm-256color",
              "host-spawn",
              "zsh",
          ]
      },
}

WIP.