diff --git a/src/vm/commands/quote.ts b/src/vm/commands/quote.ts index 074c1f5..83c9c13 100644 --- a/src/vm/commands/quote.ts +++ b/src/vm/commands/quote.ts @@ -46,6 +46,7 @@ export class Quote extends Command<{ with?: StrTerm }> { } sub = stripQuotemarkLayer(sub) + sub = sub.replaceAll(quote, `\\${quote}`) return `${quote}${sub}${quote}` } })) diff --git a/src/vm/lexer.ts b/src/vm/lexer.ts index a009817..56b8275 100644 --- a/src/vm/lexer.ts +++ b/src/vm/lexer.ts @@ -87,8 +87,9 @@ export class Lexer extends BehaviorSubject { continue } - // We are either starting or ending an unescaped matching quote - if ( c === `'` || c === `"` ) { + // We are either starting or ending an unescaped matching quote. + // For now, only parse single quotes. Makes it nicer to type " in commands. + if ( c === `'` ) { if ( c === this.inQuote ) { this.inQuote = undefined await this.emitToken('quote', true)