Configuring Editor and Diff Applications on Windows

Info & Tags

Article #:
17
Created:
03/06/07
Modified:
02/27/08

SUMMARY

Configuration issues for P4EDITOR and P4DIFF on Windows


DETAILS

On Windows, applications used for P4EDITOR and P4DIFF must run as foreground processes. The Perforce client creates temporary files which are passed to the editor or diff application. The Perforce client then waits for the editor or diff application to return before collecting the contents of the temporary files. However, some editor or diff programs may spawn themselves and return to the Perforce client before the intended work has been completed, which results in errors related to the missing temporary files.

You can get around this problem in one of two ways:

  • Unset the environment variable SHELL. Perforce uses the Command Prompt, cmd.exe, when SHELL is set. Otherwise, Perforce calls the spawn() Windows API function, which will not return until the called program has finished.

  • If your editor/diff program supports a command line flag to prevent it from spawning a new process, set P4EDITOR or P4DIFF to the name of a DOS batch file that launches it with that flag.