You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Keyboard shortcut for comment toggle not working in environment variable editors #4402
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:
Add an explicit commentKeymap (from @codemirror/commands) to the extensions and ensure the properties language defines its comment token (e.g., lineComment: "#"), or
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.
Activity
dosubot commentedon May 13, 2026
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
CodeEditorcomponent [1] uses CodeMirror 6 with@uiw/react-codemirror. The environment variable editor usesStreamLanguage.define(properties)from@codemirror/legacy-modes/mode/properties[2], while the YAML editor uses the nativeyaml()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-intoggleCommentcommand uses. However,StreamLanguage-wrapped legacy modes (like thepropertiesmode) don't always provide the comment token metadata needed forCmd+/to work.To fix this, you'd likely need to either:
commentKeymap(from@codemirror/commands) to the extensions and ensure thepropertieslanguage defines its comment token (e.g.,lineComment: "#"), or.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 aLanguageDatafacet that providescommentTokens: { line: "#" }. Something like: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.
fix: enable comment toggle shortcut in env variable editor (#4402) (#…
🚀 Release v0.29.5 (#4475)
🚀 Release v0.29.6 (#4514)
🚀 Release v0.29.8 (#4562)
chore(release): 0.37.0 [skip ci]