I am trying to open kdiff3 from the terminal and pass two local file as argument of kdiff3 (not in git repo). Kdiff3 I am using as git diff tool thats works perfectly fine to compare my current version and repo head version. However, the problem occur when I run the kdiff3 with local file (not in git repo) as a argument from terminal then I get an error saying that, FSPathMakeRef(local_kdiff_path/kdiff3.app ) failed with error -43.
FYI, kdiff3.app path location is exactly same as I define for git diff tool or alias. Following two ways I tried, but none of them work :
alias kd2='open -a "local_kdiff_path/kdiff3.app" $1 $2'
alias kd3='sudo open -a "local_kdiff_path/kdiff3.app/Contents/MacOS/kdiff3" $1 $2'
Please suggest me how I can resolve this issue ?
The problem is the path you define in your bash script
or .bash_profile
can not find the application location. Even though the argument is easily accessible in Linux or Windows but for mac specific the script is bit different.
MAC OS-X Solution
Create a simple bash script as follows and provide the arguments
kdiff_installed_folder/kdiff3.app/Contents/MacOS/kdiff3 "$1" "$2" "$4"
Linux Solution
Add following commands in the .bashrc or .aliases file
alias kd '/app/kdiff3/0.9.96/RHEL64/kdiff3'
alias kd1 '/app/kdiff3/0.9.96/RHEL64/kdiff3 $1'
alias kd2 '/app/kdiff3/0.9.96/RHEL64/kdiff3 $1 $2'
Windows Solution
If you install the Git-bash
add following line in the .bashrc file
alias kd='"C:/Program Files/KDiff3/kdiff3.exe"'
alias kd1='"C:/Program Files/KDiff3/kdiff3.exe" $1'
alias kd2='"C:/Program Files/KDiff3/kdiff3.exe" $1 $2'