#
# Cygwin-specific customizations for fish
#

# Prepend system directories to PATH
for p in /bin /usr/local/bin
	if not contains $p $PATH
		set -x PATH $p $PATH
	end
end
__fish_reconstruct_path	# ... but make sure fish_user_paths still comes first


#
# Settings for interactive shells
#

if status is-interactive

	# The fish_config command uses BROWSER to open its configuration page.
	# If BROWSER isn't set, it will try to use a text or X11 browser.
	# In Cygwin, cygstart is generally a better option.
	# It opens a tab in the default Windows browser, and also converts
	# paths in file:// URL arguments from Cygwin to Windows form.
	set -x BROWSER cygstart

end

#
# Settings for login shells
#

if status is-login

	# Run commands in /etc/profile.d/*.fish
	for file in /etc/profile.d/*.fish
		source $file
	end
	
	# Set a default value for LANG if it's not already set
	if not set -q LANG
		set -gx LANG en_US.UTF-8
	end

	# Start in $HOME
	if not set -q CHERE_INVOKING
		cd
	end

end
