mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 22:14:53 +00:00
Change configuration file names if installing in $HOME
darcs-hash:20050926123306-ac50b-c2a277903de798d553fe61e1045eb6c3dae0036d.gz
This commit is contained in:
parent
b445294ff9
commit
6e1af6d9c3
8 changed files with 54 additions and 4758 deletions
|
@ -78,5 +78,8 @@
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
|
/* System configuration directory */
|
||||||
|
#undef SYSCONFDIR
|
||||||
|
|
||||||
/* Evil kludge to get Power based machines to work */
|
/* Evil kludge to get Power based machines to work */
|
||||||
#undef TPUTS_KLUDGE
|
#undef TPUTS_KLUDGE
|
||||||
|
|
15
configure.ac
15
configure.ac
|
@ -1,5 +1,5 @@
|
||||||
# Process this file with autoconf to produce a configure script.
|
# Process this file with autoconf to produce a configure script.
|
||||||
AC_INIT(fish,1.14.0,axel@liljencrantz.se)
|
AC_INIT(fish,1.14.1,axel@liljencrantz.se)
|
||||||
|
|
||||||
AC_CANONICAL_TARGET
|
AC_CANONICAL_TARGET
|
||||||
|
|
||||||
|
@ -47,16 +47,12 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo $prefix | grep \^$HOME >/dev/null; then
|
if echo $prefix | grep \^$HOME >/dev/null; then
|
||||||
AC_SUBST(sysconfdir,[$HOME])
|
AC_SUBST(sysconfdir,[$HOME/etc])
|
||||||
AC_SUBST(fishdir,[/.fish.d])
|
|
||||||
AC_SUBST(fishfile,[/.fish])
|
|
||||||
AC_SUBST(fishinputfile,[/.fish_inputrc])
|
|
||||||
AC_MSG_NOTICE(["Install in $HOME"])
|
AC_MSG_NOTICE(["Install in $HOME"])
|
||||||
else
|
|
||||||
AC_SUBST(fishdir,[/fish.d])
|
|
||||||
AC_SUBST(fishfile,[/fish])
|
|
||||||
AC_SUBST(fishinputfile,[/fish_inputrc])
|
|
||||||
fi
|
fi
|
||||||
|
AC_SUBST(fishdir,[/fish.d])
|
||||||
|
AC_SUBST(fishfile,[/fish])
|
||||||
|
AC_SUBST(fishinputfile,[/fish_inputrc])
|
||||||
|
|
||||||
AC_ARG_VAR( [docdir], [Documentation direcotry] )
|
AC_ARG_VAR( [docdir], [Documentation direcotry] )
|
||||||
|
|
||||||
|
@ -65,6 +61,7 @@ if test -z $docdir; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_DEFINE_UNQUOTED( DOCDIR, [L"$(eval echo $docdir)"], [Documentation directory] )
|
AC_DEFINE_UNQUOTED( DOCDIR, [L"$(eval echo $docdir)"], [Documentation directory] )
|
||||||
|
AC_DEFINE_UNQUOTED( SYSCONFDIR, [L"$(eval echo $sysconfdir)"], [System configuration directory] )
|
||||||
|
|
||||||
# See if Linux procfs is present
|
# See if Linux procfs is present
|
||||||
AC_CHECK_FILES([/proc/self/stat])
|
AC_CHECK_FILES([/proc/self/stat])
|
||||||
|
|
|
@ -651,16 +651,15 @@ Here are some of the commands available in the editor:
|
||||||
- Alt-l lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed
|
- Alt-l lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed
|
||||||
- Alt-k prints a list of all key bindings
|
- Alt-k prints a list of all key bindings
|
||||||
|
|
||||||
You can change these key bindings making an inputrc file. To do this,
|
You can change these key bindings by making an inputrc file. To do
|
||||||
copy the file /etc/fish_inputrc to your home directory and rename it
|
this, copy the file /etc/fish_inputrc to your home directory and
|
||||||
to '.fish_inputrc'. You can do this by running the command <tt>mv
|
rename it to '.fish_inputrc'. Now you can edit the file .fish_inputrc,
|
||||||
/etc/fish_inputrc ~/.fish_inputrc</tt>. Now you can edit the file
|
to change your key bindings. The fileformat of this file is described
|
||||||
.fish_inputrc, to change your key bindings. The fileformat of this file
|
in the manual page for readline. Use the command <tt>man readline</tt>
|
||||||
is described in the manual page for readline. Use the command <tt>man
|
to read up on this syntax. Please note thet the key binding support in
|
||||||
readline</tt> to read up on this syntax. Please note thet the
|
\c fish is still limited. You can not use the set command or the
|
||||||
key binding support in \c fish is still limited. You can not use the
|
keyname-syntax, and the list functions is incomplete. Currently, the
|
||||||
set command or the keyname-syntax, and the list functions is
|
following functions are available:
|
||||||
incomplete. Currently, the following functions are available:
|
|
||||||
|
|
||||||
|
|
||||||
- \c backward-char, moves one character to the left
|
- \c backward-char, moves one character to the left
|
||||||
|
@ -833,6 +832,16 @@ has occured. These functions are:
|
||||||
- \c fish_on_exec, which is called before interactively executing a command
|
- \c fish_on_exec, which is called before interactively executing a command
|
||||||
- \c fish_on_return, which is called when control returns to the shell after interactively executing a command
|
- \c fish_on_return, which is called when control returns to the shell after interactively executing a command
|
||||||
|
|
||||||
|
\section issues Common issues with fish
|
||||||
|
|
||||||
|
If you install fish in your home directory, fish will not work
|
||||||
|
correctly for any other user than yourself. This is because fish needs
|
||||||
|
it's initalization files to function properly. To solve this
|
||||||
|
problem, either copy the initialization files to each fish users home
|
||||||
|
directory, or install them in /etc.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\section todo Missing features and bugs
|
\section todo Missing features and bugs
|
||||||
|
|
||||||
\subsection todo-features Missing features
|
\subsection todo-features Missing features
|
||||||
|
|
27
init/fish.in
27
init/fish.in
|
@ -53,25 +53,6 @@ if count $LANG >/dev/null
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Load additional initialization files
|
|
||||||
#
|
|
||||||
|
|
||||||
if test -d fish.d
|
|
||||||
# If this file is installed in /etc, the subdirectory is called fish.d
|
|
||||||
for i in fish.d/*.fish
|
|
||||||
. $i
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if test -d .fish.d
|
|
||||||
# If this file is installed in ~, the subdirectory is called .fish.d
|
|
||||||
for i in .fish.d/*.fish
|
|
||||||
. $i
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# There are variables that contain colons that are not arrays. This
|
# There are variables that contain colons that are not arrays. This
|
||||||
# reverts them back to regular strings.
|
# reverts them back to regular strings.
|
||||||
|
@ -82,3 +63,11 @@ for i in DISPLAY
|
||||||
set -- $i (printf ":%s" $$i|cut -c 2-)
|
set -- $i (printf ":%s" $$i|cut -c 2-)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#
|
||||||
|
# Load additional initialization files
|
||||||
|
#
|
||||||
|
|
||||||
|
for i in fish.d/*.fish
|
||||||
|
. $i
|
||||||
|
end
|
||||||
|
|
|
@ -41,7 +41,7 @@ end
|
||||||
# by including them when found.
|
# by including them when found.
|
||||||
#
|
#
|
||||||
|
|
||||||
for i in ~/.fish_inputrc /etc/fish_inputrc ~/.inputrc /etc/inputrc
|
for i in ~/.fish_inputrc ~/etc/fish_inputrc /etc/fish_inputrc ~/.inputrc /etc/inputrc
|
||||||
if test -f $i
|
if test -f $i
|
||||||
set -xg INPUTRC $i
|
set -xg INPUTRC $i
|
||||||
break
|
break
|
||||||
|
|
32
input.c
32
input.c
|
@ -465,8 +465,6 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar_t *ggg = in;
|
|
||||||
|
|
||||||
for( i=0; i<chars; i++ )
|
for( i=0; i<chars; i++ )
|
||||||
{
|
{
|
||||||
int d = convert_digit( *in++, base);
|
int d = convert_digit( *in++, base);
|
||||||
|
@ -498,6 +496,7 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
||||||
if( *in != L'-' )
|
if( *in != L'-' )
|
||||||
{
|
{
|
||||||
error=1;
|
error=1;
|
||||||
|
debug( 1, L"Invalid sequence - no dash after control\n" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
in++;
|
in++;
|
||||||
|
@ -515,7 +514,7 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
||||||
*(out++)=*in-L'A'+1;
|
*(out++)=*in-L'A'+1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// fwprintf( stderr, L"No char after\n" );
|
debug( 1, L"Invalid sequence - Control-nothing?\n" );
|
||||||
error = 1;
|
error = 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -530,28 +529,16 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
||||||
if( *in != L'-' )
|
if( *in != L'-' )
|
||||||
{
|
{
|
||||||
error=1;
|
error=1;
|
||||||
// fwprintf( stderr, L"no dash\n" );
|
debug( 1, L"Invalid sequence - no dash after meta\n" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
in++;
|
if( !*(in+1) )
|
||||||
|
|
||||||
if( (*in >= L'a') &&
|
|
||||||
(*in <= L'z') )
|
|
||||||
{
|
{
|
||||||
*(out++)=L'\e';
|
debug( 1, L"Invalid sequence - Meta-nothing?" );
|
||||||
*(out++)=*in;
|
error=1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (*in >= L'A') &&
|
|
||||||
(*in <= L'Z') )
|
|
||||||
{
|
|
||||||
*(out++)=L'\e';
|
*(out++)=L'\e';
|
||||||
*(out++)=*in;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
// fwprintf( stderr, L"No char after\n" );
|
|
||||||
error = 1;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -579,7 +566,6 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
||||||
|
|
||||||
if( error )
|
if( error )
|
||||||
{
|
{
|
||||||
// fwprintf( stderr, L"%ls had errors\n", in_orig );
|
|
||||||
free( res);
|
free( res);
|
||||||
res=0;
|
res=0;
|
||||||
}
|
}
|
||||||
|
@ -589,10 +575,14 @@ static wchar_t *input_expand_sequence( const wchar_t *in )
|
||||||
*out = L'\0';
|
*out = L'\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !error )
|
||||||
|
{
|
||||||
if( wcslen( res ) == 0 )
|
if( wcslen( res ) == 0 )
|
||||||
{
|
{
|
||||||
debug( 1, L"Sequence '%ls' expanded to zero characters, skipped", in_orig );
|
debug( 1, L"Invalid sequence - '%ls' expanded to zero characters", in_orig );
|
||||||
error =1;
|
error =1;
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
2
main.c
2
main.c
|
@ -71,7 +71,7 @@ static int read_init()
|
||||||
|
|
||||||
env_set( L"__fish_help_dir", DOCDIR, 0);
|
env_set( L"__fish_help_dir", DOCDIR, 0);
|
||||||
|
|
||||||
eval( L"builtin cd /etc 2>/dev/null; . fish 2>/dev/null", 0, TOP );
|
eval( L"builtin cd " SYSCONFDIR L" 2>/dev/null; . fish 2>/dev/null", 0, TOP );
|
||||||
eval( L"builtin cd 2>/dev/null;. .fish 2>/dev/null", 0, TOP );
|
eval( L"builtin cd 2>/dev/null;. .fish 2>/dev/null", 0, TOP );
|
||||||
|
|
||||||
if( chdir( cwd ) == -1 )
|
if( chdir( cwd ) == -1 )
|
||||||
|
|
Loading…
Reference in a new issue