Skip to content

Incompatibility with Z shell and direnv: Invalid session ID ... #731

@peterbecich

Description

@peterbecich

Describe the bug

This issue is related to Z shell and https://github.com/direnv/direnv, and possibly https://github.com/nix-community/nix-direnv.

I think the issue is completely unrelated to Nix.

I have tested both Copilot CLI 0.0.365 and 0.0.367.

The error is:

   Invalid session ID: 1. Please supply a valid session ID to read ...

It occurs in these cases:

  • shell is Z shell; then direnv allow to configure the shell; then copilot
    or
  • nix develop -c /bin/zsh; then copilot

It does not occur when:

  • shell is Z shell and not using direnv (direnv revoke); then copilot
    or
  • shell is bash; then direnv allow to configure the shell; then copilot
    or
  • shell is arbitrary; then nix develop to open Nix shell (default is bash); then copilot

Therefore, I suspect the issue is the combination of Z shell and direnv.

The issue #640 does not mention direnv, hence the new issue.

Workaround

  • Enter the nix develop shell (or nix-shell); this is a bash shell by default
  • then start copilot

or

  • bash
  • then direnv allow

The valid session ID error should not happen.

Affected version

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions