CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-external-editor

tessl install tessl/npm-external-editor@3.1.0

Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT

Agent Success

Agent success rate when using this tile

79%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.05x

Baseline

Agent success rate without this tile

75%

task.mdevals/scenario-4/

Editor Exit Reporter

Captures text from a user-invoked external editor, returning both the saved content and the editor's exit status without treating non-zero exits as fatal.

Capabilities

Captures edited text

  • Given initial text "Draft note" the function resolves with the updated content after the user saves, returning exitStatus 0. @test

Returns empty saves

  • When the user saves an empty file, the function resolves with an empty string and exitStatus 0 rather than substituting defaults or throwing. @test

Surfaces non-zero exit

  • If the editor process ends with exit code 1 after the user saves "keep me", the function resolves without throwing, returning that content and exitStatus 1. @test

Implementation

@generates

The returned exitStatus should mirror the editor process exit code; use null only when no code is available.

API

export interface EditorResult {
  text: string;
  exitStatus: number | null;
}

export interface EditorOptions {
  initialText?: string;
}

export function runEditorSession(options?: EditorOptions): Promise<EditorResult>;

Dependencies { .dependencies }

external-editor { .dependency }

Launches the user's preferred text editor and captures edited file contents.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/external-editor@3.1.x
tile.json