# Why set $ARGV0 ?!

**URL:** <https://forum.cursor.com/t/why-set-argv0/77428>\
**Category:** Bug Reports\
**Created:** [April 10, 2025, 6:15am UTC](https://forum.cursor.com/t/why-set-argv0/77428 "2025-04-10T06:15:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirius-fan](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/sirius-fan/32/45862_2.png) [@sirius-fan](https://forum.cursor.com/u/sirius-fan)\
**Post date:** [April 10, 2025, 6:15am UTC](https://forum.cursor.com/t/why-set-argv0/77428/1 "2025-04-10T06:15:04Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/a/7/a73df4276212e695f8562a04adfefc7127908f46.png)

Obviously the parameters passed to the program have been tampered with by the cursor. Let’s write a small program to demonstrate the problem.

```c
#include <stdio.h>
int main(int argc, char *argv[])
{
    for(int i=0;i<argc;i++){
        printf("%s\n",argv[i]);
    }

}

```

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/6/b/6b90af446ac8d23d243262cf499f823fd3a707cf.png)

Incorrect compilation

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/7/c/7cd605d647cb44bdd9fbdbb5ade0bd1585f43ced.png)

Obviously cargo can’t be used either

> <https://github.com/getcursor/cursor/issues/549#issuecomment-1934666368>
>
> For some reason, \`ARGV0\` gets overwritten when running commands, which affects s…everal commands in the rust toolchain such as \`cargo\` and \`rustup\`.
> 
> The same issue can be observed in similar situations at GitSquared/edex-ui#1124 and onivim/oni2#3830.

The correct result should be

```auto
# ~/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) 

```

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [May 10, 2025, 6:15am UTC](https://forum.cursor.com/t/why-set-argv0/77428/2 "2025-05-10T06:15:14Z")

</div>

Closed on May 10, 2025, 6:15am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
