Skip to content

Commit

Permalink
Add escape shortcut to escape from prompt mode (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
nichochar authored Jul 19, 2024
1 parent 899b2c7 commit cbeafb6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/web/src/components/cells/code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ export default function CodeCell(props: {
{ enableOnFormTags: ['textarea'] },
);

useHotkeys(
'escape',
() => {
if (promptMode === 'idle') {
setPromptMode('off');
setPrompt('');
}
},

{ enableOnFormTags: ['textarea'] },
);

const { updateCell, clearOutput } = useCells();

function setFilenameError(error: string | null) {
Expand Down

0 comments on commit cbeafb6

Please sign in to comment.