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-5/

Editor Exit Session

A utility that opens the user's editor on a temporary file and reports both the edited content and the editor process exit code.

Capabilities

Capture exit status on successful edit

  • Starting with text "hello", after the user saves without changes and exits normally, return the same text and an exit status of 0. @test

Surface non-zero exit codes

  • When the editor command exits with code 42 without modifying the file, return the original text and an exit status of 42. @test

Allow custom editor command

  • Given a custom editor command that writes "done" into the file and exits with code 0, return "done" and an exit status of 0. @test

Expose last exit status

  • Before any run, the accessor reports null; after a run it returns the most recent exit status value. @test

Implementation

@generates

API

export type EditorRunOptions = {
  editorCommand?: string;
  initialText?: string;
};

export type EditorRunResult = {
  content: string;
  exitStatus: number | null;
};

export function editOnce(options?: EditorRunOptions): Promise<EditorRunResult>;
export function editOnceSync(options?: EditorRunOptions): EditorRunResult;
export function getLastExitStatus(): number | null;

Dependencies { .dependencies }

external-editor { .dependency }

Provides access to the user's preferred text editor and exposes the process exit status.

Version

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