GSQL History not working properly in gsq_client.jar

When I use GSQL from the Linux command line on the server, I can use the up and down arrow keys to view my command history.

However, when I run the GSQL client locally, on my own machine, using java -jar gsql_client.jar, which is ostensibly the same client, I get garbage when I use the up and down arrow keys to try and access my command history.

Do you all have any idea what is causing this issue and how I can fix it?

FYI, I am using a Windows 10 client running under Amazon Workspaces with all of the latest patches.

I have the exact same issue, I think I asked about it a few months ago. I have also observed that the same behavior occurs from both standard CMD.exe and the newer Windows Powershell. Basically, any arrow keys generate a garbage character, which is especially frustrating when you have just entered a long command.

1 Like

Yes, that is exactly what I am experiencing. I am just running from the command prompt. I just tested again in PowerShell and got the exact same behavior.

I would really like to fix this because having access to my command history is a great productivity enhancer.

Totally agree - an admittedly poor workaround, but one that I have used for certain things is to wrap the command in a window batch file, like this

java -jar gsql_client.jar -ip yourserver -u youruserid -p yourpwd -g yourgraphname %*

if you put that line in .bat file, then you can run commands and at least use the windows history.

So for instance, if the bat file is called rungsql.bat, then from the windows command line you can run

rungsql show query myTestQuery

and since it exits after the command, you can use the up arrow for history. Obviously it would be better to stay in the gsql shell and have the history work there, but this is a technique I have used for scripting.

1 Like

Mark,

I am using essentially that script in a batch file with the exception of the %* at the end. (Also, I put the IP address of the server in a separate file called gsql_server_ip_config.)

What does the %* do?

Anthony

it allows you to pass the command via the command line to the script and it will run that command and return, even there are spaces.

rungsql show query myTestQuery

everything after the name of script is passed as arguments and run by the batch file

1 Like

@markmegerian @anthony.gatlin I’m brining this to the attention of the product team.

Keep you posted on updates.

2 Likes

Thank you, Jon! :slight_smile:

Last week I did test it out on Mac and history worked. I’ll need to spin up a Windows machine to test functionality on Windows next. @anthony.gatlin Keep you posted.

1 Like

Feel free to send me a jar that I can test on windows