code-with-codespaces icon indicating copy to clipboard operation
code-with-codespaces copied to clipboard

[Bug]

Open iriru opened this issue 10 months ago • 4 comments
trafficstars

Summary

"Command not found" error when running sl too soon after opening a codespace

After opening a new codespace and running the setup.sh script, running the sl command too soon results in a "command not found" error. This happens because the environment variables are not yet fully set.

How to reproduce

  1. Open a new codespace.
  2. Immediately run the sl command:
sl

Expected Result

The sl command should run successfully.

Actual Result

The terminal returns a "command not found" error.

Image

Additional context

This issue occurs because the sl command is run before the environment variables are fully applied. To prevent this, please wait a sufficient amount of time before running the command. If the issue has already occurred, try the following method:

source ~/.bashrc
sl

iriru avatar Jan 18 '25 14:01 iriru

"Issue might be caused by user error, but I wanted to document it as I continue to learn. I will also try to create a pull request for this issue later, but unfortunately, I can't do more at the moment."

iriru avatar Jan 18 '25 14:01 iriru

@jhonatanparada499 , there are currently no reviewers available for this pull request. Could you please review it and merge if everything looks good? Thank you!

iriru avatar Jan 19 '25 14:01 iriru

@iriru Thank you for raising this issue! I'll get this triaged for review :sparkles: Our team will provide feedback regarding the best next steps for this issue - thanks for your patience! 💛

nguyenalex836 avatar Jan 20 '25 19:01 nguyenalex836

@nguyenalex836 I found that updating the postCreateCommand helps solve the issue, can you please review this PR and merge if it looks good? https://github.com/skills/code-with-codespaces/pull/160

tfredrick112 avatar Apr 25 '25 13:04 tfredrick112