mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Fix to disable VDSUSP, which allows control-Y to serve as yank on OS X
This commit is contained in:
parent
b7ba252965
commit
f8e3e853aa
2 changed files with 17 additions and 3 deletions
13
input.cpp
13
input.cpp
|
@ -434,8 +434,8 @@ static wint_t input_exec_binding( const input_mapping_t &m, const wcstring &seq
|
|||
*/
|
||||
static wint_t input_try_mapping( const input_mapping_t &m)
|
||||
{
|
||||
int j, k;
|
||||
wint_t c=0;
|
||||
int j;
|
||||
|
||||
/*
|
||||
Check if the actual function code of this mapping is on the stack
|
||||
|
@ -448,15 +448,22 @@ static wint_t input_try_mapping( const input_mapping_t &m)
|
|||
input_unreadch( c );
|
||||
|
||||
const wchar_t *str = m.seq.c_str();
|
||||
for( j=0; str[j] != L'\0' && str[j] == (c=input_common_readch( j>0 )); j++ )
|
||||
;
|
||||
for (j=0; str[j] != L'\0'; j++)
|
||||
{
|
||||
bool timed = (j > 0);
|
||||
c = input_common_readch(timed);
|
||||
if (str[j] != c)
|
||||
break;
|
||||
}
|
||||
|
||||
if( str[j] == L'\0' )
|
||||
{
|
||||
/* We matched the entire sequence */
|
||||
return input_exec_binding( m, m.seq );
|
||||
}
|
||||
else
|
||||
{
|
||||
int k;
|
||||
/*
|
||||
Return the read characters
|
||||
*/
|
||||
|
|
|
@ -672,6 +672,13 @@ void reader_init()
|
|||
shell_modes.c_cc[VMIN]=1;
|
||||
shell_modes.c_cc[VTIME]=0;
|
||||
|
||||
// PCA disable VDSUSP (typically control-Y), which is a funny job control
|
||||
// function available only on OS X and BSD systems
|
||||
// This lets us use control-Y for yank instead
|
||||
#ifdef VDSUSP
|
||||
shell_modes.c_cc[VDSUSP] = _POSIX_VDISABLE;
|
||||
#endif
|
||||
|
||||
/* Repaint if necessary before each byte is read. This lets us react immediately to universal variable color changes. */
|
||||
input_common_set_poll_callback(reader_repaint_if_needed);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue