SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Setting the TERM variable to xterm in xterm as well

toastal opened this issue ยท 5 comments

commented

My term is set to set -x TERM xterm-256color. If I set it to xterm globally or add something similar to the else line with set TERM xtrem; $LAUNCHER it works.

For context I use xmonad + kitty + fish.

Bonus: you should change your shebang from #!/bin/bash to #!/usr/bin/env bash.

commented

Thanks! Pull requests are welcome if you want to submit the changes. Otherwise I'll look into those for the upcoming SMAPI 3.0 release.

commented

What is the actual problem here? The shell script should be running in bash, and all commands are run using sh. Is the script not picking up the TERM variable? Or is there an issue because you've replaced /bin/sh with fish?

I tried running with fish on my system and had no issues.

commented

@kurumushi I think you're right and I was too quick to think this was fish-related.

xterm doesn't automatically set the TERM=xterm nor does it run sh. All of the other branches set the TERM=xterm terminal and run the $COMMAND with sh, but the first branch, xterm, is still run with $TERM set to xterm-256color and user's default shell (with mine being fish).

# current command
# xterm -e "$LAUNCHER"
xterm -e "sh -c 'TERM=xterm $LAUNCHER'"

Moving to this command like the other branches seems to work. Why is the first branch specifically not changing the $TERM and running sh, @Pathoschild ? I'd assume there's a reason or I'd PR this.

commented

If we could assume that every terminal would work with TERM set to xterm, it might be possible to change the command to 'env TERM=xterm ./StardewModdingAPI.bin $*' and avoid all this mess.

Also just for reference, this is all related to mono/mono#6752

commented

@toastal I'm mainly a Windows dev, so the Linux/Mac script was cobbled together over time based on issues Linux players have reported. Feel free to submit further changes where they make sense; the upcoming SMAPI 3.0 will have a lengthy beta, so it's a good time to make changes like this.