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

Editor Preference Session

A utility that selects a terminal editor from environment preferences and runs it while exposing resolved command details.

Capabilities

Picks editor preference

  • Prefers VISUAL when set; VISUAL="nano --wait" yields bin "nano", args ["--wait"] while EDITOR is ignored @test
  • Uses EDITOR when VISUAL is missing; EDITOR="code --wait --new-window" yields bin "code", args ["--wait", "--new-window"] @test
  • Falls back to platform default ("vim" on non-Windows, "notepad" on Windows) when neither variable is set @test

Runs editing session

  • Launches the resolved editor with provided text, returns the saved text, and includes resolved bin/args plus exit status @test

Implementation

@generates

API

export type EditorCommand = {
  bin: string;
  args: string[];
};

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

/**
 * Resolves the editor command to run based on VISUAL, EDITOR, or platform fallback.
 * @param env optional environment values to inspect
 */
export function resolveEditor(env?: NodeJS.ProcessEnv): EditorCommand;

/**
 * Runs an editable session using the resolved editor.
 * @param initialText optional prefilled contents
 * @param env optional environment values to inspect
 */
export function runEditorSession(initialText?: string, env?: NodeJS.ProcessEnv): Promise<EditorRunResult>;

Dependencies { .dependencies }

external-editor { .dependency }

Launches a user-configured external editor and exposes the resolved command and args. @satisfied-by

Version

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