Nim icon indicating copy to clipboard operation
Nim copied to clipboard

osproc.startProcess should support "not following symlinks"

Open jinwoo opened this issue 9 months ago • 2 comments

Description

Some tools behave differently depending on by which name they are being invoked. For example, when vim is invoked via the view symlink, it opens in a read-only mode.

startProcess seems to always follow the symlink of the given command and use the actual executable instead of the originally given name when given a symlink as the command. So we can't control the behavior of the invoked command using the symlink names.

There should be a way to tell it to not follow the symlink. Maybe create a new enum value for ProcessOption.

Nim Version

2.0.4

Current Output

No response

Expected Output

No response

Possible Solution

No response

Additional Information

No response

jinwoo avatar May 07 '24 22:05 jinwoo

This problem seems to happen when the given command is not a full path and the poUsePath is specified.

jinwoo avatar May 07 '24 23:05 jinwoo

My workaround was to use os.findExe() with followSymlinks set to false, instead of using the poUsePath option of startProcess.

jinwoo avatar May 09 '24 15:05 jinwoo