diff --git a/.changeset/fuzzy-lies-agree.md b/.changeset/fuzzy-lies-agree.md new file mode 100644 index 00000000000..f5b8d63ccff --- /dev/null +++ b/.changeset/fuzzy-lies-agree.md @@ -0,0 +1,5 @@ +--- +'@shopify/theme': patch +--- + +Fix issue where theme dev shortcuts keys would not work when using the 'theme-editor-sync' flag diff --git a/packages/theme/src/cli/services/dev.ts b/packages/theme/src/cli/services/dev.ts index a54ef69fcf8..45e47e8c47c 100644 --- a/packages/theme/src/cli/services/dev.ts +++ b/packages/theme/src/cli/services/dev.ts @@ -123,9 +123,6 @@ export async function dev(options: DevOptions) { const {serverStart, renderDevSetupProgress, backgroundJobPromise} = setupDevServer(options.theme, ctx) readline.emitKeypressEvents(process.stdin) - if (process.stdin.isTTY) { - process.stdin.setRawMode(true) - } const keypressHandler = createKeypressHandler(urls, ctx) process.stdin.on('keypress', keypressHandler) @@ -135,6 +132,9 @@ export async function dev(options: DevOptions) { renderDevSetupProgress() .then(serverStart) .then(() => { + if (process.stdin.isTTY) { + process.stdin.setRawMode(true) + } renderLinks(urls) if (options.open) { openURLSafely(urls.local, 'development server')