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

Editor Charset Capture

Collect a short note from the user's configured editor and guarantee the returned text is correctly decoded to UTF-8, even when the saved file uses varied encodings.

Capabilities

Decodes edited note regardless of charset

Use the dependency-backed editor launch to decode saved files according to their detected charset, defaulting to UTF-8 when detection cannot determine the encoding.

  • Saving text encoded as UTF-16LE returns the exact string content without replacement characters. @test
  • Saving text encoded as Windows-1252 preserves characters like "cafe - EUR" when returned. @test
  • Saving an empty file returns an empty string without throwing. @test
  • When the saved file uses an unrecognized charset, the text is decoded as UTF-8. @test

Implementation

@generates

API

/**
 * Launches the user's preferred text editor to capture a note.
 *
 * @param {string} [initialText] Optional starting content to prefill the editor.
 * @returns {string} The final text saved by the user, decoded to UTF-8.
 */
export function captureNote(initialText);

Dependencies { .dependencies }

external-editor { .dependency }

Launches the user's preferred editor, handles charset detection of the saved file, and decodes text with a UTF-8 fallback.

Version

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