Skip to content

Clarify "allowCommands" setup #190

@eric-burel

Description

@eric-burel

Is your feature request related to a problem?

I am hitting an error jsh: permission denied: astro when switching from the Vite default template to an Astro app.
After some digging, this seems to be a security system that prevents the terminal to run random commands in the webcontainer. And it seems that the allowCommands configuration field should help with that, but I fail to figure it out based on the current documentation.

image

Describe the solution you'd like.

  • We may be able to define some default allowed commands at template level, or at tutorial level
  • The allowCommands setting should be made explicit in the Vite demo so we quickly figure how to tweak it for a new technology (if it's the right setting which I am not sure of yet)
  • The permission denied error could be made more explicit
  • Tiny improvements : highlight and ctrl+c doesn't seem to work in the terminal, also I observe a freeze just before the webcontainer starts installing package, not sure of the cause yet
  • I am pretty sure I didn't observe the same behaviour on my other computer, the Next app was running with no setting from me. I don't have a reliable reproduction yet, perhaps you updated the project since.

Describe alternatives you've considered.

I've tried setting up my lesson frontmatter like so, no luck:

---
type: lesson
title: Welcome to AstroPatterns
terminal:
  panels: "output"
  allowCommands: ["astro"]

Additional context

I think the error is related to allowCommands but perhaps the "jsh" error stems from another issue I don't know about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions