SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Error when Terminator is default terminal: "Unable to find a shell"

andoruB opened this issue ยท 14 comments

commented

SMAPI version: 1.12
Stardew Valley version: 1.2.26
OS: Debian Unstable 64-bit

I get a terminal with "Unable to find a shell" when running the game from the default shell script ("./StardewValley"). At first I thought it might have been an permission issue, as after I added executable permissions to my user to all the executables in the StardewValley folder, it worked, but after a reboot, it gives me the same error again.

commented

I'm also hitting this. I'm glad I wasn't alone, but can't seem to spot a resolution. Any tips?

commented

Self-update:

I ran sudo update-alternatives --config x-terminal-emulator and picked something that wasn't terminator. The gnome terminal (which I normally use) worked great! :)

commented

I have patched this: #419

commented

@2E0PGS Removing the quotes in #420 fixes Terminator, which makes sense when you consider the note on its man page:

-e, --command=COMMAND
Runs the specified command instead of your default shell or profile specified command. Note: if Terminator is launched as x-terminal-emulator -e behaves like -x, and the longform becomes --execute2=COMMAND

-x, --execute COMMAND [ARGS]
Runs the rest of the command line instead of your default shell or profile specified command.

Converting -e to -x seems like very strange behaviour, and I have no idea why Terminator does it. Removing the quotes may cause issues when arguments are passed in (e.g. from Steam), so I'd rather not do that. Does Terminator work if we replace x-terminal-emulator -e with x-terminal-emulator --command?

commented

@Pathoschild Give my latest commit to develop a try:

Repo: https://github.com/2E0PGS/SMAPI

Commit: 2E0PGS@a8b354a

File: https://github.com/2E0PGS/SMAPI/blob/a8b354a6037c903c708663311a7b1da67ab989f3/src/SMAPI/unix-launcher.sh

If this works for you with no issues as mentioned before then I can create a pull request.

commented

@2E0PGS Unfortunately that would affect players who have Terminator installed but use another terminal as default. In that case, x-terminal-emulator would be skipped and SMAPI would use fallback logic (which only checks a few terminals before disabling the terminal entirely). We'd need to check if x-terminal-emulator is mapped to Terminator.

Maybe we can just treat x-terminal-emulator as a fallback instead, and support some common terminals directly:

    if $COMMAND gnome-terminal 2>/dev/null; then
        gnome-terminal -e "$LAUNCHER"
    elif $COMMAND xfce4-terminal 2>/dev/null; then
        xfce4-terminal -e "$LAUNCHER"
    elif $COMMAND xterm 2>/dev/null; then
        xterm -e "$LAUNCHER"
    elif $COMMAND konsole 2>/dev/null; then
        konsole -e "$LAUNCHER"
    elif $COMMAND terminal 2>/dev/null; then
        terminal -e "$LAUNCHER"
    elif $COMMAND terminator 2>/dev/null; then
        terminator -e "$LAUNCHER"
    elif $COMMAND x-terminal-emulator 2>/dev/null; then
        x-terminal-emulator -e "$LAUNCHER"
    else
        $LAUNCHER
    fi
commented

Your right not sure how I overlooked that. Ok looks like I may have to do a grep solution.

commented

@2E0PGS I think treating x-terminal-emulator as a fallback instead of the default (see the code I pasted above) would fix your issue.

commented

Ideally we want to stick to using the default if possible since either of our solutions could make the user unhappy with the choice if not using default. If we do fallback like in my code I think it would be better to use a more plain terminal / minimal. Since its a rare case I would think someone has terminator installed. So I suggest two main options.:

  • I modify that code I wrote above but swap the order of fallbacks to something simple and plain.
  • We ignore all defaults like you suggested and just assume their preference.
  • I try and find the best way to grab the output of the default x-terminal-emulator which works on both stock and terminator versions of that file.

I will look into the latter. But if that fails I think its best to try default and fallback like in my code. Even if its falling back for users who have terminator installed but not default its a rare case and thats the workaround...

commented

Fixed via #425 and merged into develop for the upcoming SMAPI 2.4. Thanks @2E0PGS and @EnderHDMC!

commented

Hi @andoruB. Can you come ask in #modding on Discord? There are more people familiar with Linux there who can help you figure it out. The issues here are mainly for tracking development tasks. :)

commented

Wow, his must be the first github project where I can't submit issues on the issues tracker!
Discord does not work properly here, and keeps asking me to install their stupid app. Any alternatives...?

commented

Yep, you can post in the SMAPI support thread instead.

This isn't the best place to ask because only a few core developers monitor GitHub issues. If you ask on Discord or the forums, you can get help from a much larger community of modders and players who aren't necessarily involved in SMAPI development.

commented

But, weren't you the one who made the bash scripts...? And okay, will hop over to the forums and ask.