mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 12:51:12 -03:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
780ecc46fc | ||
|
|
9b98df8310 | ||
|
|
5a8205ac2b | ||
|
|
2490da31ce | ||
|
|
092bb90569 | ||
|
|
39ca027706 | ||
|
|
22433f2717 | ||
|
|
f6e194447d | ||
|
|
e2ed5d0977 |
@@ -283,7 +283,9 @@ install: all
|
|||||||
$(INSTALL) -m 644 init/fish_inputrc $(DESTDIR)$(sysconfdir)$(fishinputfile);
|
$(INSTALL) -m 644 init/fish_inputrc $(DESTDIR)$(sysconfdir)$(fishinputfile);
|
||||||
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
|
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
|
||||||
for i in user_doc/html/* ChangeLog; do \
|
for i in user_doc/html/* ChangeLog; do \
|
||||||
$(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
|
if test -f $$i; then \
|
||||||
|
$(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
|
||||||
|
fi; \
|
||||||
done;
|
done;
|
||||||
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
|
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
|
||||||
for i in $(MANUALS); do \
|
for i in $(MANUALS); do \
|
||||||
|
|||||||
2
common.c
2
common.c
@@ -923,6 +923,8 @@ wchar_t *escape( const wchar_t *in,
|
|||||||
case L'@':
|
case L'@':
|
||||||
case L'(':
|
case L'(':
|
||||||
case L')':
|
case L')':
|
||||||
|
case L'[':
|
||||||
|
case L']':
|
||||||
case L'{':
|
case L'{':
|
||||||
case L'}':
|
case L'}':
|
||||||
case L'?':
|
case L'?':
|
||||||
|
|||||||
@@ -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.18.0,fish-users@lists.sf.net)
|
AC_INIT(fish,1.18.1,fish-users@lists.sf.net)
|
||||||
|
|
||||||
AC_CANONICAL_TARGET
|
AC_CANONICAL_TARGET
|
||||||
|
|
||||||
|
|||||||
@@ -737,14 +737,16 @@ Here are some of the commands available in the editor:
|
|||||||
- End or Ctrl-e moves to the end of line
|
- End or Ctrl-e moves to the end of line
|
||||||
- Left and right moves one character left or right
|
- Left and right moves one character left or right
|
||||||
- Alt-left and Alt-right moves one word left or right, or moves forward/backward in the directory history if the commandline is empty
|
- Alt-left and Alt-right moves one word left or right, or moves forward/backward in the directory history if the commandline is empty
|
||||||
|
- Up and down search the command history for the previous/next command containing the string that was specified on the commandline before the search was started. If the commandline was empty when the search started, all commands match. See the <a href='#history'>history </a>section for more information on history searching.
|
||||||
|
- Alt-up and Alt-down search the command history for the previous/next token containing the token under the cursor before the search was started. If the commandline was not on a token when the search started, all tokens match. See the <a href='#history'>history </a>section for more information on history searching.
|
||||||
- Delete and backspace removes one character forwards or backwards
|
- Delete and backspace removes one character forwards or backwards
|
||||||
- Ctrl-c delete entire line
|
- Ctrl-c delete entire line
|
||||||
- Ctrl-d delete one character to the right of the cursor, unless the buffer is empty, in which case the shell will exit
|
- Ctrl-d delete one character to the right of the cursor, unless the buffer is empty, in which case the shell will exit
|
||||||
- Ctrl-k move contents from cursor to end of line to <a href="#killring">killring</a>
|
- Ctrl-k move contents from the cursor to the end of line to the <a href="#killring">killring</a>
|
||||||
- Ctrl-u move contents from beginning of line to cursor <a href="#killring">killring</a>
|
- Ctrl-u move contents from the beginning of line to the cursor to the <a href="#killring">killring</a>
|
||||||
- Ctrl-l clear and repaint screen
|
- Ctrl-l clear and repaint screen
|
||||||
- Ctrl-w move previous word to <a href="#killring">killring</a>
|
- Ctrl-w move previous word to the <a href="#killring">killring</a>
|
||||||
- Alt-d move next word to <a href="#killring">killring</a>
|
- Alt-d move next word to the <a href="#killring">killring</a>
|
||||||
- Alt-w prints a short description of the command under the cursor
|
- Alt-w prints a short description of the command under the cursor
|
||||||
- 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
|
||||||
@@ -807,6 +809,14 @@ forwards and backwards in the history. If the current command line is
|
|||||||
not empty when starting a history search, only the commands containing
|
not empty when starting a history search, only the commands containing
|
||||||
the string entered into the command line are shown.
|
the string entered into the command line are shown.
|
||||||
|
|
||||||
|
By pressing Alt-up and Alt-down, a history search is also performed,
|
||||||
|
but instead of searching for a complete commandline, each commandline
|
||||||
|
is tokenized into separate elements just like it would be before
|
||||||
|
execution, and each such token is matched agains the token under the
|
||||||
|
cursor when the search began.
|
||||||
|
|
||||||
|
History searches can be aborted by pressing the escape key.
|
||||||
|
|
||||||
The history is stored in the file '.fish_history'. It is automatically
|
The history is stored in the file '.fish_history'. It is automatically
|
||||||
read on startup and merged on program exit.
|
read on startup and merged on program exit.
|
||||||
|
|
||||||
@@ -1020,7 +1030,7 @@ If you think you have found a bug not described here, please send a
|
|||||||
report to <a href="mailto:axel@liljencrantz.se"> axel@liljencrantz.se
|
report to <a href="mailto:axel@liljencrantz.se"> axel@liljencrantz.se
|
||||||
</a>.
|
</a>.
|
||||||
|
|
||||||
\subsection Known issues
|
\subsection issues Known issues
|
||||||
|
|
||||||
Older versions of Doxygen has bugs in the man-page generation which
|
Older versions of Doxygen has bugs in the man-page generation which
|
||||||
cause the builtin help to render incorrectly. Version 1.2.14 is known
|
cause the builtin help to render incorrectly. Version 1.2.14 is known
|
||||||
|
|||||||
2
expand.c
2
expand.c
@@ -68,7 +68,7 @@ parameter expansion.
|
|||||||
#define COMPLETE_LAST_DESC COMPLETE_SEP_STR L"Last background job"
|
#define COMPLETE_LAST_DESC COMPLETE_SEP_STR L"Last background job"
|
||||||
|
|
||||||
#define COMPLETE_VAR_DESC L"Variable name is zero characters long."
|
#define COMPLETE_VAR_DESC L"Variable name is zero characters long."
|
||||||
#define COMPLETE_VAR2_DESC L" Did you mean {$VARIABLE}? For information on how variable expansion in fish differs from Posix variable expansion, see the manual section on variable expansion by typing 'help expand-variable'."
|
#define COMPLETE_VAR2_DESC L"Variable name is zero characters long. Did you mean{$VARIABLE}? To learn about variable expansion in fish, type 'help expand-variable'."
|
||||||
|
|
||||||
/**
|
/**
|
||||||
String in process expansion denoting ourself
|
String in process expansion denoting ourself
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
complete -c fish -s c -l "command" -d "Run fish with this command"
|
complete -c fish -s c -l "command" -d "Run fish with this command"
|
||||||
complete -c fish -s h -l help -d "Display help and exit"
|
complete -c fish -s h -l help -d "Display help and exit"
|
||||||
complete -c fish -l version -d "Display version and exit"
|
complete -c fish -s v -l version -d "Display version and exit"
|
||||||
complete -c fish -s i -l interactive -d "Run in interactive mode"
|
complete -c fish -s i -l interactive -d "Run in interactive mode"
|
||||||
complete -c fish -s p -l profile -d "Output profiling information to specified file" -f
|
complete -c fish -s p -l profile -d "Output profiling information to specified file" -f
|
||||||
|
|||||||
39
parser.c
39
parser.c
@@ -202,11 +202,14 @@ void parser_push_block( int type )
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
New blocks should be skipped if the outer block is skipped,
|
New blocks should be skipped if the outer block is skipped,
|
||||||
except TOP ans SUBST block, which open up new environments
|
except TOP ans SUBST block, which open up new environments. Fake
|
||||||
|
blocks should always be skipped. Rather complicated... :-(
|
||||||
*/
|
*/
|
||||||
new->skip=current_block?current_block->skip:0;
|
new->skip=current_block?current_block->skip:0;
|
||||||
if( type == TOP || type == SUBST )
|
if( type == TOP || type == SUBST )
|
||||||
new->skip = 0;
|
new->skip = 0;
|
||||||
|
if( type == FAKE )
|
||||||
|
new->skip = 1;
|
||||||
|
|
||||||
new->job = 0;
|
new->job = 0;
|
||||||
|
|
||||||
@@ -658,7 +661,7 @@ wchar_t *get_filename( const wchar_t *cmd )
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
debug( 1,
|
debug( 1,
|
||||||
L"Error while searching for command %d",
|
L"Error while searching for command %ls",
|
||||||
new_cmd );
|
new_cmd );
|
||||||
wperror( L"access" );
|
wperror( L"access" );
|
||||||
}
|
}
|
||||||
@@ -763,13 +766,6 @@ static void print_errors()
|
|||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
|
|
||||||
/*
|
|
||||||
Wildcard warnings are only printed in interactive mode
|
|
||||||
*/
|
|
||||||
if( ( error_code == WILDCARD_ERROR ) && !is_interactive )
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
debug( 0, L"%ls", err_str );
|
debug( 0, L"%ls", err_str );
|
||||||
|
|
||||||
tmp = current_tokenizer_pos;
|
tmp = current_tokenizer_pos;
|
||||||
@@ -1268,11 +1264,21 @@ static void parse_job_main_loop( process_t *p,
|
|||||||
{
|
{
|
||||||
if( unmatched_wildcard && !matched_wildcard )
|
if( unmatched_wildcard && !matched_wildcard )
|
||||||
{
|
{
|
||||||
error( WILDCARD_ERROR,
|
j->wildcard_error = 1;
|
||||||
unmatched_pos,
|
proc_set_last_status( 1 );
|
||||||
WILDCARD_ERR_MSG,
|
if( is_interactive && !is_block )
|
||||||
unmatched );
|
{
|
||||||
|
int tmp;
|
||||||
|
|
||||||
|
debug( 1, WILDCARD_ERR_MSG, unmatched );
|
||||||
|
tmp = current_tokenizer_pos;
|
||||||
|
current_tokenizer_pos = unmatched_pos;
|
||||||
|
|
||||||
|
fwprintf( stderr, L"%ls", parser_current_line() );
|
||||||
|
|
||||||
|
current_tokenizer_pos=tmp;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free( unmatched );
|
free( unmatched );
|
||||||
@@ -1700,7 +1706,6 @@ static int parse_job( process_t *p,
|
|||||||
*/
|
*/
|
||||||
while( prev_block != current_block )
|
while( prev_block != current_block )
|
||||||
parser_pop_block();
|
parser_pop_block();
|
||||||
|
|
||||||
}
|
}
|
||||||
al_destroy( &args );
|
al_destroy( &args );
|
||||||
|
|
||||||
@@ -1719,9 +1724,10 @@ static int parse_job( process_t *p,
|
|||||||
static void skipped_exec( job_t * j )
|
static void skipped_exec( job_t * j )
|
||||||
{
|
{
|
||||||
process_t *p;
|
process_t *p;
|
||||||
|
|
||||||
for( p = j->first_process; p; p=p->next )
|
for( p = j->first_process; p; p=p->next )
|
||||||
{
|
{
|
||||||
if( p->type )
|
if( p->type == INTERNAL_BUILTIN )
|
||||||
{
|
{
|
||||||
if(( wcscmp( p->argv[0], L"for" )==0) ||
|
if(( wcscmp( p->argv[0], L"for" )==0) ||
|
||||||
( wcscmp( p->argv[0], L"switch" )==0) ||
|
( wcscmp( p->argv[0], L"switch" )==0) ||
|
||||||
@@ -1850,6 +1856,7 @@ static void eval_job( tokenizer *tok )
|
|||||||
}
|
}
|
||||||
|
|
||||||
skip |= current_block->skip;
|
skip |= current_block->skip;
|
||||||
|
skip |= j->wildcard_error;
|
||||||
|
|
||||||
if(!skip )
|
if(!skip )
|
||||||
{
|
{
|
||||||
|
|||||||
3
proc.h
3
proc.h
@@ -134,6 +134,9 @@ typedef struct job
|
|||||||
/** Should the exit status be negated? This flag can only be set by the not builtin. */
|
/** Should the exit status be negated? This flag can only be set by the not builtin. */
|
||||||
int negate;
|
int negate;
|
||||||
|
|
||||||
|
/** This flag is set to one on wildcard expansion errors. It means that the current command should not be executed */
|
||||||
|
int wildcard_error;
|
||||||
|
|
||||||
/** Pointer to the next job */
|
/** Pointer to the next job */
|
||||||
struct job *next;
|
struct job *next;
|
||||||
}
|
}
|
||||||
|
|||||||
17
reader.c
17
reader.c
@@ -1382,8 +1382,8 @@ static int handle_completions( array_list_t *comp )
|
|||||||
0,
|
0,
|
||||||
0 );
|
0 );
|
||||||
|
|
||||||
len = &data->buff[data->buff_pos]-prefix_start;
|
len = &data->buff[data->buff_pos]-prefix_start+1;
|
||||||
|
|
||||||
if( len <= PREFIX_MAX_LEN )
|
if( len <= PREFIX_MAX_LEN )
|
||||||
{
|
{
|
||||||
prefix = malloc( sizeof(wchar_t)*(len+1) );
|
prefix = malloc( sizeof(wchar_t)*(len+1) );
|
||||||
@@ -1400,7 +1400,7 @@ static int handle_completions( array_list_t *comp )
|
|||||||
;
|
;
|
||||||
|
|
||||||
prefix = wcsdupcat( tmp,
|
prefix = wcsdupcat( tmp,
|
||||||
prefix_start + (len - PREFIX_MAX_LEN+1) );
|
prefix_start + (len - PREFIX_MAX_LEN) );
|
||||||
prefix[PREFIX_MAX_LEN] = 0;
|
prefix[PREFIX_MAX_LEN] = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2586,10 +2586,13 @@ wchar_t *reader_readline()
|
|||||||
|
|
||||||
case R_BACKWARD_KILL_LINE:
|
case R_BACKWARD_KILL_LINE:
|
||||||
{
|
{
|
||||||
wchar_t prev = data->buff[data->buff_pos];
|
wchar_t *str = wcsndup( data->buff, data->buff_pos );
|
||||||
data->buff[data->buff_pos]=0;
|
if( !str )
|
||||||
kill_add( data->buff );
|
die_mem();
|
||||||
data->buff[data->buff_pos]=prev;
|
|
||||||
|
kill_add( str );
|
||||||
|
free( str );
|
||||||
|
|
||||||
data->buff_len = wcslen(data->buff +data->buff_pos);
|
data->buff_len = wcslen(data->buff +data->buff_pos);
|
||||||
memmove( data->buff, data->buff +data->buff_pos, sizeof(wchar_t)*data->buff_len );
|
memmove( data->buff, data->buff +data->buff_pos, sizeof(wchar_t)*data->buff_len );
|
||||||
data->buff[data->buff_len]=L'\0';
|
data->buff[data->buff_len]=L'\0';
|
||||||
|
|||||||
Reference in New Issue
Block a user