fix: term opening on Linux (#845)

This commit is contained in:
lollipopkit🏳️‍⚧️
2025-08-12 23:55:31 +08:00
committed by GitHub
parent 9b01da5a23
commit 8c0e0f89d5
2 changed files with 15 additions and 57 deletions

View File

@@ -20,7 +20,7 @@ jobs:
uses: subosito/flutter-action@v2 uses: subosito/flutter-action@v2
with: with:
channel: "stable" channel: "stable"
flutter-version: "3.32.2" flutter-version: "3.32.8"
- uses: actions/setup-java@v4 - uses: actions/setup-java@v4
with: with:
distribution: "zulu" distribution: "zulu"
@@ -58,24 +58,17 @@ jobs:
run: | run: |
sudo apt update sudo apt update
# Basic # Basic
sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev libvulkan-dev desktop-file-utils wget sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev mesa-utils libvulkan-dev desktop-file-utils wget
# App Specific # App Specific
sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev sudo apt install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev libsecret-1-dev
# Packaging
sudo wget https://github.com/AppImage/appimagetool/releases/download/1.9.0/appimagetool-x86_64.AppImage -O /bin/appimagetool
sudo chmod +x /bin/appimagetool
- name: Build - name: Build
run: | run: |
dart run fl_build -p linux dart run fl_build -p linux
- name: Rename artifacts
run: |
appimage_name=$(ls dist/*/*.AppImage)
mv $appimage_name ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.appimage
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
files: | files: |
${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.appimage ${{ env.APP_NAME }}_${{ env.BUILD_NUMBER }}_amd64.AppImage
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -281,59 +281,24 @@ bool _checkClient(BuildContext context, String id) {
const _runEmulatorShell = ''' const _runEmulatorShell = '''
#!/bin/sh #!/bin/sh
# launch_terminal.sh
TERMINAL="\$1" TERMINAL="\$1"
shift # Remove the first argument (terminal name) shift
# Auto detect terminal if not provided
if [ -z "\$TERMINAL" ] || [ "\$TERMINAL" = "x-terminal-emulator" ]; then if [ -z "\$TERMINAL" ] || [ "\$TERMINAL" = "x-terminal-emulator" ]; then
# Follow the order of preference for term in kitty alacritty gnome-terminal gnome-console konsole xfce4-terminal terminator tilix wezterm foot xterm; do
for term in kitty alacritty gnome-terminal konsole xfce4-terminal terminator tilix wezterm foot; do command -v "\$term" >/dev/null 2>&1 && { TERMINAL="\$term"; break; }
if command -v "\$term" >/dev/null 2>&1; then
TERMINAL="\$term"
break
fi
done done
[ -z "\$TERMINAL" ] && TERMINAL="x-terminal-emulator" [ -z "\$TERMINAL" ] && TERMINAL="x-terminal-emulator"
fi fi
case "\$TERMINAL" in case "\$TERMINAL" in
gnome-terminal) gnome-terminal|gnome-console) exec "\$TERMINAL" -- "\$@" ;;
exec "\$TERMINAL" -- "\$@"
;;
konsole|terminator|tilix)
exec "\$TERMINAL" -e "\$@"
;;
xfce4-terminal)
exec "\$TERMINAL" -e "\$*"
;;
alacritty) alacritty)
# Check alacritty version "\$TERMINAL" --version 2>&1 | grep -q "alacritty 0\\.1[3-9]" &&
if "\$TERMINAL" --version 2>&1 | grep -q "alacritty 0\\.1[3-9]"; then exec "\$TERMINAL" --command "\$@" || exec "\$TERMINAL" -e "\$@" ;;
# 0.13.0+ kitty|foot) exec "\$TERMINAL" "\$@" ;;
exec "\$TERMINAL" --command "\$@" wezterm) exec "\$TERMINAL" start -- "\$@" ;;
else xfce4-terminal) exec "\$TERMINAL" -e "\$*" ;;
# Old versions *) exec "\$TERMINAL" -e "\$@" ;;
exec "\$TERMINAL" -e "\$@"
fi
;;
kitty)
exec "\$TERMINAL" "\$@"
;;
wezterm)
exec "\$TERMINAL" start -- "\$@"
;;
foot)
exec "\$TERMINAL" "\$@"
;;
urxvt|rxvt-unicode)
exec "\$TERMINAL" -e "\$@"
;;
x-terminal-emulator|*)
# Default
exec "\$TERMINAL" -e "\$@"
;;
esac esac
'''; ''';