Bash in Shell Wrapper

Hello everyone.

I have a maven/java application that I need to run in a bash session. When creating the snap, a shell wrapper is generated. The shell wrapper contains:

#!/bin/sh
exec $SNAP/bin/java -Djava.util.prefs.userRoot="$SNAP_USER_DATA" -Dorg.jline.terminal.dumb=true -jar $SNAP/jar/rpncalc.jar "$@"

I need to run in bash as the readline will handle scan codes. How can I have the wrapper created with:

#!/bin/bash

Is there a way to configure this? Can I build my own “wrapper”?

I appreciate the help.

Frosty

Hello all. Ok, I’ve created a wrapper script and bash now seems to be the shell I’m running under.

Here’s a bit more detail of my problem. My app is a command line calculator that has the user enter input. If I run the JAR file directly, the user can use the up and down arrow keys to move through a history of what they’ve entered. Awesome.

But when the application is installed as a snap, I get the scan codes instead of the behavior I’m looking for.

Up arrow comes in as: ^[[A

Down arrow comes in as ^[[B

My first thought was the shell the wrapper was running the application under. sh vs bash. I believe sh does not process the scan codes properly.

However, I now have the custom wrapper installed and working well. I confirmed with $SHELL that it is running under bash but the same issue is occuring.

I know this is a pretty specific problem, but since it runs great outside of snap, but fails with it, I’m hoping someone can point me in the right direction.

Frosty