Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT
79
A helper that collects text asynchronously by launching the user's external editor and returning the saved contents.
trimTrailingNewline is true, a single trailing newline at the end of the saved content is removed; otherwise the text is returned unchanged. @test@generates
export interface AsyncEditOptions {
fileOptions?: {
prefix?: string;
postfix?: string;
template?: string;
dir?: string;
mode?: number;
};
trimTrailingNewline?: boolean;
}
/**
* Launch the user's editor asynchronously with optional initial text.
* Resolves with the final text or rejects if editing fails.
*/
export function openDraft(
initialText?: string,
options?: AsyncEditOptions
): Promise<string>;Provides asynchronous editing via the user's configured external editor.
Install with Tessl CLI
npx tessl i tessl/npm-external-editordocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10