Skip to content

Keyboard shortcut for comment toggle not working in environment variable editors #4402

Closed

Description

@amit-y11

To Reproduce

  1. Navigate to Project -> Select a Project -> Select any service -> Environment
  2. Enter some environment variables in the editor (e.g., MY_VAR=value)
  3. Place cursor on any line and press:
    • Cmd+/ on macOS
    • Ctrl+/ on Windows/Linux
  4. Expected: Comment syntax (#) is added to the line
  5. Actual: Nothing happens - no comment is added

Current vs. Expected behavior

Current behavior:

  • Comment toggle (cmd+/) works in YAML editors (Docker Compose)
  • Comment toggle (cmd+/) is completely non-functional in environment variable editors
  • This creates inconsistent UX across different code editors in the application

Expected behavior:

  • cmd+/ should work uniformly across all code editors, including environment variable and secret editors
  • The keyboard shortcut should add # line comments in env editors just like it does in YAML editors

Provide environment information

Operating System: Mac OS
Dokploy version: v0.29.4

Which area(s) are affected? (Select all that apply)

Local Development, Cloud Version

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

Yes

Activity

  1. dosubot commented on May 13, 2026

    @dosubot

    Hi @amit-y11! I'm Dosu and I’m helping the dokploy team.

    Thanks for the detailed report! I looked into this and can confirm the root cause.

    The CodeEditor component [1] uses CodeMirror 6 with @uiw/react-codemirror. The environment variable editor uses StreamLanguage.define(properties) from @codemirror/legacy-modes/mode/properties [2], while the YAML editor uses the native yaml() language support from @codemirror/lang-yaml [3].

    The key difference is that native CodeMirror 6 language packages (like @codemirror/lang-yaml) include comment token definitions that the built-in toggleComment command uses. However, StreamLanguage-wrapped legacy modes (like the properties mode) don't always provide the comment token metadata needed for Cmd+/ to work.

    To fix this, you'd likely need to either:

    1. Add an explicit commentKeymap (from @codemirror/commands) to the extensions and ensure the properties language defines its comment token (e.g., lineComment: "#"), or
    2. Create a custom language support for .env/properties files using the modern CodeMirror 6 API that includes proper comment token configuration.

    The simplest approach would be to use StreamLanguage.define(properties) but supplement it with a LanguageData facet that provides commentTokens: { line: "#" }. Something like:

    import { LanguageDescription } from "@codemirror/language";
    
    // Add to extensions when language is "properties":
    EditorState.languageData.of(() => [{ commentTokens: { line: "#" } }])

    This would make Cmd+/ / Ctrl+/ work for toggling # comments in the env editor.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about dokploy with Dosu Add Dosu to your team

  2. added a commit that references this issue on May 22, 2026
  3. added a commit that references this issue on May 30, 2026
  4. added a commit that references this issue on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions