xataio / xataio/learn-postgres

Shell: trailing comments after semicolon never submit

Open
#148 1 comment 0 reactions 1 assignee View on GitHub

@dascalescuro is already working on this.

Since Aug 27, 2026.

bug ready-for-agent
Dominant language
MDX
Stars
7
Forks
1
Avg merge
1d 2h
Merged PRs (30d)
36

Description

Symptom

In the browser shell, a statement that ends with ; followed by a -- or /* */ comment stays on the continuation prompt (learn->) instead of running.

Examples that fail to submit:

  • SELECT 1; -- done
  • SELECT 1;/* done */
  • SELECT 1;\n-- done

Expected

isStatementComplete (and the shell docstring) treat the last non-comment, non-whitespace character as decisive — so these should submit like psql.

Red loop (already run)

import { isStatementComplete } from './components/shell/sql-complete.ts';
isStatementComplete('SELECT 1; -- x'); // got false, expect true

Where

  • components/shell/sql-complete.ts — final check is /;\s*$/, which does not skip trailing comments
  • Called from components/shell/readline.ts on Enter

Notes

Diagnosed with /diagnosing-bugs. Minimized repro is the three inputs above; plain SELECT 1; still works.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.