Wait for the renderer to suspend and resume
OpenTUI 0.8 suspends and resumes asynchronously and refuses to resume mid-transition, so $EDITOR and an attached terminal wait for each step.
This commit is contained in:
1 parent
b35263b41b
commit
60e2357dab
6 files changed
+18
-17
No files matched your search
+2
-2
@@ -516,10 +516,10 @@ export function App(props: { readonly session: T3Session; readonly config: T3tui
|
||||
const workspace = useWorkspace({ session, renderer, live, thread: threadShell, project, serverConfig: serverConfig?.config ?? null, draft: draft !== null, diff, openPicker, confirm, run, say });
|
||||
|
||||
/** The composer's text in $EDITOR. */
|
||||
const openEditor = () => {
|
||||
const openEditor = async () => {
|
||||
const composer = composerRef.current;
|
||||
if (!composer) return;
|
||||
const edited = editInEditor(renderer, composer.plainText);
|
||||
const edited = await editInEditor(renderer, composer.plainText);
|
||||
if (edited === null) return say("The editor exited with an error; the message is unchanged.", true);
|
||||
composer.setText(edited);
|
||||
composer.gotoBufferEnd();
|
||||
|
||||
Reference in new issue
Block a user