Skip to main content
better answer, better markdown
Source Link
RobertL
  • 6.9k
  • 1
  • 22
  • 39

The most likelyOne common cause of this type of error is that your script depends upon executing in a specific directory, and the launcher doesn't start the script in that directory.

Another cause could be differences in the shell environment. Most likely your PATH variable and/or your current working directory is different and affecting your script.

You can check both with one procedure.

To check the difference in the environment and working directories do this:

  1. Start gvimgvim from the terminal and in that gvimgvim, enter:

     :!env > /tmp/env.terminal
    
  2. Start gvimgvim from the launcher and in that gvimgvim enter:

     :!env > /tmp/env.launcher
    
  3. In a Terminal window, at the shell prompt, enter

     diff /tmp/env.terminal /tmp/env.launcher
    

If the problem is different working directories, youThis diff command will see differencesshow the difference in the valueenvironments of the PWD environment variableboth gvim instances.

You will also see any otherLook at the differences in environment variables, for example if a variable is different or non-existent in one of the environments. Be sure to check the values of both the PATH and PWD variables.

The most likely cause of this type of error is that your script depends upon executing in a specific directory, and the launcher doesn't start the script in that directory.

Another cause could be differences in the shell environment.

You can check both with one procedure.

To check the difference in the environment and working directories do this:

  1. Start gvim from the terminal and in that gvim, enter:

     :!env > /tmp/env.terminal
    
  2. Start gvim from the launcher and in that gvim enter:

     :!env > /tmp/env.launcher
    
  3. In a Terminal window, at the shell prompt, enter

     diff /tmp/env.terminal /tmp/env.launcher
    

If the problem is different working directories, you will see differences in the value of the PWD environment variable.

You will also see any other differences in environment variables, for example if a variable is different or non-existent in one of the environments.

One common cause of this type of error is differences in the shell environment. Most likely your PATH variable and/or your current working directory is different and affecting your script.

You can check with one procedure.

To check the difference in the environment and working directories do this:

  1. Start gvim from the terminal and in that gvim, enter:

     :!env > /tmp/env.terminal
    
  2. Start gvim from the launcher and in that gvim enter:

     :!env > /tmp/env.launcher
    
  3. In a Terminal window, at the shell prompt, enter

     diff /tmp/env.terminal /tmp/env.launcher
    

This diff command will show the difference in the environments of both gvim instances.

Look at the differences in the environments. Be sure to check the values of both the PATH and PWD variables.

Source Link
RobertL
  • 6.9k
  • 1
  • 22
  • 39

The most likely cause of this type of error is that your script depends upon executing in a specific directory, and the launcher doesn't start the script in that directory.

Another cause could be differences in the shell environment.

You can check both with one procedure.

To check the difference in the environment and working directories do this:

  1. Start gvim from the terminal and in that gvim, enter:

     :!env > /tmp/env.terminal
    
  2. Start gvim from the launcher and in that gvim enter:

     :!env > /tmp/env.launcher
    
  3. In a Terminal window, at the shell prompt, enter

     diff /tmp/env.terminal /tmp/env.launcher
    

If the problem is different working directories, you will see differences in the value of the PWD environment variable.

You will also see any other differences in environment variables, for example if a variable is different or non-existent in one of the environments.