On Nov 26, 2012, at 10:12 PM, Ian Munsie <darkstarsw...@gmail.com> wrote:

> On Tue, Nov 27, 2012 at 2:34 PM, Luciano ES <lucm...@gmail.com> wrote:
>> function fish_user_key_bindings
>>        bind -k dc delete-or-exit
>>        bind \cz 'commandline ""'
>> end
>> 
>> I press Ctrl+z. Nothing happens.
> 
> Nothing happens for me either - might be a bug, though something in
> the back of my mind is nagging at me saying that you can't bind
> anything to ctrl+z unless you first remove susp with stty - only,
> changing that doesn't seem to stick in fish (I wonder if it's
> resetting the terminal characteristics - I'd need to read the code).

Here's where fish sets up the terminal characteristics. As Ian says, fish does 
not disable VDSUSP, so control-Z generates a signal instead of being sent to 
fish. If fish were smarter it might change this dynamically depending on what 
bindings are installed.

void reader_init()
{
    tcgetattr(0,&shell_modes);        /* get the current terminal modes */
    memcpy(&saved_modes,
           &shell_modes,
           sizeof(saved_modes));     /* save a copy so we can reset the 
terminal later */

    shell_modes.c_lflag &= ~ICANON;   /* turn off canonical mode */
    shell_modes.c_lflag &= ~ECHO;     /* turn off echo mode */
    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



------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
DESIGN Expert tips on starting your parallel project right.
http://goparallel.sourceforge.net
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to