Skip to content

feat: add Run Script command for script files in editor - #2048

Open
xielixing wants to merge 1 commit into
GCWing:mainfrom
xielixing:fix/issue-1566-run-script
Open

feat: add Run Script command for script files in editor#2048
xielixing wants to merge 1 commit into
GCWing:mainfrom
xielixing:fix/issue-1566-run-script

Conversation

@xielixing

Copy link
Copy Markdown

Summary

Adds a Run Script command that detects the script language of a file and executes it in a new terminal session. This implements the feature requested in #1566.

Changes

  • New file: \RunScriptCommand.ts\ — Implements the \ ile.run-script\ context menu command:
    • Maps file extensions to interpreters via language detection (Python, JavaScript, TypeScript, Shell, PowerShell, Batch, Ruby, Go, Rust, PHP, Lua, Perl)
    • Creates a terminal session, sends the run command, and opens the terminal panel
    • Disabled for remote workspaces and non-file URI schemes
  • Tab.tsx — Adds a \Run Script\ context menu item in the editor tab, shown only when the file has a recognized interpreter
  • file/index.ts — Registers \RunScriptCommand\ in the builtin file commands
  • i18n — Adds
    unScript,
    unScriptDescription,
    unScriptStarting,
    unScriptSessionName\ keys and
    unScriptFailed,
    unScriptUnsupported\ error keys for en-US, zh-CN, zh-TW

Validation

  • TypeScript/esbuild compile check passed (no errors in changed files)
  • JSON locale files validated (valid syntax, key parity across en-US/zh-CN/zh-TW)
  • i18n key parity check passed (all keys present in all 3 locales)

Closes #1566

Adds a RunScriptCommand that detects the script language and runs it
in a new terminal session. Supports Python, JavaScript, TypeScript,
Shell, PowerShell, Batch, Ruby, Go, Rust, PHP, Lua, and Perl.

Also adds a Run Script entry to the tab context menu, shown only when
the file has a recognized interpreter.

Closes GCWing#1566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Is there any script running environment

1 participant