Skip to content

Instantly share code, notes, and snippets.

@will
Created June 10, 2022 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will/b5745d599ec94cfb1c9fa5f110ba0791 to your computer and use it in GitHub Desktop.
Save will/b5745d599ec94cfb1c9fa5f110ba0791 to your computer and use it in GitHub Desktop.
play girl from Ipanema while your query runs
diff --git i/src/bin/psql/mainloop.c w/src/bin/psql/mainloop.c
index b0c4177..dcb4b5a 100644
--- i/src/bin/psql/mainloop.c
+++ w/src/bin/psql/mainloop.c
@@ -82,6 +82,8 @@ MainLoop(FILE *source)
/* main loop to get queries and execute them */
while (successResult == EXIT_SUCCESS)
{
+ system("killall -q afplay");
+
/*
* Clean up after a previous Control-C
*/
@@ -436,6 +438,7 @@ MainLoop(FILE *source)
/* execute query unless we're in an inactive \if branch */
if (conditional_active(cond_stack))
{
+ if (pset.cur_cmd_interactive) { system("afplay /Users/will/code/ipanema_psql/gfi2.mov &"); }
success = SendQuery(query_buf->data);
slashCmdStatus = success ? PSQL_CMD_SEND : PSQL_CMD_ERROR;
pset.stmt_lineno = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment