When using cursor.appimage on Linux, the built-in terminal uses zsh, and there will be a very strange environment variable ARGV0
This will cause gcc and g++ to not be used
Version: 0.48.8
commit: 1.96.2
Date: 7801■■■6824585b7f2721900066bc87c4a09b740
Electron: 2025-04-07T19:55:57.662Z
ElectronBuildId: 34.3.4
Chromium: undefined
Node.js: 132.0.6834.210
V8: 20.18.3
OS: 13.2.152.41-electron.0
Obviously the parameters passed to the program have been tampered with by the cursor. Let’s write a small program to demonstrate the problem.
#include <stdio.h>
int main(int argc, char *argv[])
{
for(int i=0;i<argc;i++){
printf("%s\n",argv[i]);
}
}
Incorrect compilation
Obviously cargo can’t be used either
The correct result should be
# ~/code/sync_code/debug_shell_py on git:master x [13:49:15] C:255
$ gcc test.c -o test
# ~/code/sync_code/debug_shell_py on git:master x [13:49:29]
$ ./test he
./test
he
# ~/code/sync_code/debug_shell_py on git:master x [14:09:05] C:127
$ echo $ARGV0
# ~/code/sync_code/debug_shell_py on git:master x [14:13:38]
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.1 20250207 (GCC)