Immediately after switching the page, it will work with CSR.
Please reload your browser to see how it works.
From the Postgres master branch (17devel), we take exec_command_d, exec_command_list and exec_command_sf_sv from command.c, and all of describe.c and sql_help.c, from src/bin/psql.
We use plenty of RegExp search-and-replace to turn this C code into valid JS syntax.
We implement some C library functions, such as strlen and strchr, and some Postgres support functions, such as printTable and printQuery, in JavaScript.
Read more here: https://neon.tech/blog/bringing-psqls-d-to-your-web-browser
I'm not sure if I entirely follow what translating C to JS gives you, other than a bit of (fairly simple) parsing of \cmd and flags? I didn't look too carefully at the code, so maybe I'm missing something.