--- mc-4.6.1/src/subshell.c.1 2005-06-07 13:19:19.000000000 +0400 +++ mc-4.6.1/src/subshell.c 2006-05-01 15:04:51.000000000 +0400 @@ -91,6 +91,9 @@ TRUE; #endif +/* Don't allow ctrl+o (panels ON) if shell already dunning a command: */ +int subshell_blocks_ctrlo=1; + /* File descriptor of the pseudoterminal used by the subshell */ int subshell_pty = 0; @@ -894,7 +897,7 @@ fd_set read_set; /* For `select' */ int maxfdp; int bytes; /* For the return value from `read' */ - int i; /* Loop counter */ + int i,j; /* Loop counter */ struct timeval wtime; /* Maximum time we wait for the subshell */ struct timeval *wptr; @@ -992,6 +995,18 @@ exit (1); } + if (subshell_blocks_ctrlo) { + if (pty_buffer[0] == subshell_switch_key && + subshell_ready == TRUE) { + subshell_state = INACTIVE; + return TRUE; + } + // remove ctrl+o codes from buffer: + for (i = 0,j = 0; i < bytes; ++i) + if (pty_buffer[i] != subshell_switch_key) + pty_buffer[j++] = pty_buffer[i]; + bytes = j; + } else { for (i = 0; i < bytes; ++i) if (pty_buffer[i] == subshell_switch_key) { write (subshell_pty, pty_buffer, i); @@ -1000,6 +1015,7 @@ return TRUE; } + } write (subshell_pty, pty_buffer, bytes); subshell_ready = FALSE; } else {