1

I'm on osx, and I installed vsql by following this.

When I input a multiline statement into vsql, then hit up, I only recall one line of the statement at a time. I would like to be able to recall and rerun multiline statements with the up arrow key.

Can someone offer assistance?

Thanks!

Max Bileschi
  • 2,103
  • 2
  • 21
  • 19

2 Answers2

1

If it is possible at all to do this, I think it would be using an initrc. I am not aware of a way, but the best I can tell you is to use \g to run a query again and \s to show the history.

woot
  • 7,406
  • 2
  • 36
  • 55
  • I'm using a vsqlrc to get things like keybindings, but I haven't been able to figure out the multiline configuration – Max Bileschi Nov 28 '16 at 20:54
  • The only thing I could think of was maybe to somehow redefine what an EOL is and make it a semicolon. I really don't know if it can be done, though. – woot Nov 28 '16 at 21:22
1

You can also use the \e metacommand to bring up the whole query in the shell default text editor.

kimbo305
  • 662
  • 3
  • 11
  • This is great, and helps quite a bit. How did you find out about this query? – Max Bileschi Nov 28 '16 at 20:53
  • I notice when rerunning a multiline command with \e, the newlines are substituted with control sequence `^J`, like `select 1;` turns into `select^J1;` when I recall it again. Maybe this is a hint to solving the problem? – Max Bileschi Nov 28 '16 at 20:58