Skip to content

Add 'environment: Edit env file' command palette entry - #360

Open
Atanusaha143 wants to merge 2 commits into
darrenburns:mainfrom
Atanusaha143:feature/edit-env-files-command
Open

Atanusaha143 wants to merge 2 commits into
darrenburns:mainfrom
Atanusaha143:feature/edit-env-files-command

Conversation

@Atanusaha143

@Atanusaha143 Atanusaha143 commented Jul 3, 2026

Copy link
Copy Markdown

Demo

Demo: editing the loaded env file via the command palette, saving in nano, and returning to Posting with variables reloaded

Summary

Adds a new command palette command, environment: Edit env file, that lets you edit the loaded .env file(s) without leaving Posting:

  • Suspends the app and opens all loaded environment files in the configured external editor ($EDITOR / $POSTING_EDITOR / the editor config setting) — the same suspend-and-edit pattern already used by the Scripts tab's Ctrl+E binding.
  • On returning from the editor, variables are reloaded immediately (and env_changed_signal is published so autocomplete etc. refresh), so it works even when watch_env_files is disabled.
  • The command only appears in the palette when environment files are actually loaded.
  • Shows a friendly warning if no editor is configured or no env files are loaded.

Motivation

Changing a variable mid-session (e.g. swapping base_url, refreshing a token) currently requires switching to another terminal or suspending manually with Ctrl+Z. This makes it a single palette command, complementing the existing environment: Load env file command.

Testing

  • Verified manually on macOS: palette command appears when env files are loaded, opens the editor (tested with nano), and reloads values on return — subsequent requests use the updated variables.
  • Warning paths verified: no $EDITOR set, and no env files loaded.

🤖 Generated with Claude Code

Atanusaha143 and others added 2 commits July 3, 2026 14:54
Adds a command palette command that suspends the app, opens the loaded
.env file(s) in the configured external editor ($EDITOR / $POSTING_EDITOR /
the 'editor' config setting), and reloads variables immediately on return —
so it works even when the watch_env_files setting is disabled.

The command only appears when environment files are loaded, and reuses
the same suspend-and-edit pattern as the Scripts tab's Ctrl+E binding.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant