From cb76a8a95f3a2fc7ac4f7a56720cec62f33160eb Mon Sep 17 00:00:00 2001 From: erw7 Date: Wed, 19 Dec 2018 14:30:58 +0900 Subject: [PATCH] genappimage: Unset $ARGV0 at invocation #9376 AppImage sets $ARGV0 which breaks zsh. Hack around this in our appimage. fixes #9341 ref https://github.com/AppImage/AppImageKit/issues/852 [ci skip] --- scripts/genappimage.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh index 2c10ed7202..ed008938f3 100755 --- a/scripts/genappimage.sh +++ b/scripts/genappimage.sh @@ -62,8 +62,17 @@ delete_blacklisted # AppDir complete. Now package it as an AppImage. ######################################################################## -# No need for a fancy script. AppRun can just be a symlink to nvim. -ln -s usr/bin/nvim AppRun +# Appimage set the ARGV0 environment variable. This causes problems in zsh. +# To prevent this, we use wrapper script to unset ARGV0 as AppRun. +# See https://github.com/AppImage/AppImageKit/issues/852 +# +cat << 'EOF' > AppRun +#!/bin/bash + +unset ARGV0 +exec "$(dirname "$(readlink -f "${0}")")/usr/bin/nvim" ${@+"$@"} +EOF +chmod 755 AppRun cd "$APP_BUILD_DIR" # Get out of AppImage directory.