Skip to content

Shell Script Formatting Not Working in Remote SSH + Dev Container Environment #393

@unSerori

Description

@unSerori

Description

When attempting to format a shell script (.sh file) using the Format Document command in Visual Studio Code, I receive the following error:

There is no formatter for 'shellscript' files installed.

Environment

Local Machine: macOS (MacBook)

Remote Environment: Debian server

Development Setup: Utilizing Dev Containers for remote development

Extensions Installed: foxundermoon.shell-format

shfmt Installation:

Local (macOS): Installed via Homebrew

Remote (Linux): Installed using Go, located at $HOME/go/bin/shfmt

Configuration

In my settings.json, I have specified the path to shfmt as follows: "shellformat.path": "$HOME/go/bin/shfmt".
Despite this configuration, the formatter does not function as expected, and the aforementioned error persists.

Questions

  1. In a Remote - SSH + Dev Container setup, should the foxundermoon.shell-format extension be installed on the local machine, the remote machine, or both?

  2. Where should shfmt be installed in this context? On the local machine, the remote machine, or inside the Dev Container?

  3. Should the shellformat.path setting be defined in the local settings.json, the remote settings, or within the Dev Container's configuration?

Additional Information

Verified that shfmt is executable at $HOME/go/bin/shfmt on the remote machine.
The foxundermoon.shell-format extension is currently installed on the local machine.

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