--- ./edit/editcmddef.h.org 2005-07-27 19:42:42.000000000 +0200 +++ ./edit/editcmddef.h 2005-07-27 19:43:59.000000000 +0200 @@ -108,6 +108,8 @@ #define CK_Check_Save_And_Quit 457 #define CK_Maximize 458 +#define CK_Toggle_Syntax 480 + /* macro */ #define CK_Begin_Record_Macro 501 #define CK_End_Record_Macro 502 --- ./edit/edit.c.org 2005-07-27 19:44:15.000000000 +0200 +++ ./edit/edit.c 2005-07-27 19:46:16.000000000 +0200 @@ -2480,6 +2480,11 @@ edit_insert_file_cmd (edit); break; + case CK_Toggle_Syntax: + option_syntax_highlighting^=1; + edit->force |= REDRAW_PAGE; + break; + case CK_Find: edit_search_cmd (edit, 0); break; --- ./edit/editkeys.c.org 2005-07-27 19:46:52.000000000 +0200 +++ ./edit/editkeys.c 2005-07-27 19:47:24.000000000 +0200 @@ -96,6 +96,7 @@ XCTRL ('k'), CK_Delete_To_Line_End, XCTRL ('l'), CK_Refresh, + XCTRL ('s'), CK_Toggle_Syntax, XCTRL ('o'), CK_Shell, XCTRL ('u'), CK_Undo, --- ./src/cmd.c.org 2005-07-27 19:56:07.000000000 +0200 +++ ./src/cmd.c 2005-07-27 19:53:15.000000000 +0200 @@ -478,6 +478,7 @@ int i; int c; int dirflag = 0; + int fileflag = 1; reg_exp = input_dialog (title, "", easy_patterns ? "*" : "."); if (!reg_exp) @@ -494,8 +495,9 @@ dirflag = 1; reg_exp_t++; } - if (reg_exp_t[strlen (reg_exp_t) - 1] == PATH_SEP) { + if ((*reg_exp_t) && reg_exp_t [strlen(reg_exp_t) - 1] == PATH_SEP){ dirflag = 1; + fileflag = 0; reg_exp_t[strlen (reg_exp_t) - 1] = 0; } @@ -506,7 +508,7 @@ if (!dirflag) continue; } else { - if (dirflag) + if (!fileflag) continue; } c = regexp_match (reg_exp_t, current_panel->dir.list[i].fname, --- ./src/file.c.org 2005-07-27 19:57:03.000000000 +0200 +++ ./src/file.c 2005-07-27 19:58:29.000000000 +0200 @@ -90,6 +90,9 @@ /* If on, default for "No" in delete operations */ int safe_delete = 0; +/* Beep never (0), after 2+ file ops (1), or after any file ops (2) */ +int op_beep_when_finished = 0; + /* This is a hard link cache */ struct link { struct link *next; @@ -2051,6 +2054,10 @@ g_free (dest); g_free (ctx->dest_mask); ctx->dest_mask = NULL; + + if( (op_beep_when_finished==2) || (op_beep_when_finished==1) ) + SLtt_beep(); + #ifdef WITH_BACKGROUND /* Let our parent know we are saying bye bye */ if (we_are_background) { --- ./src/key.c.org 2005-07-27 19:58:57.000000000 +0200 +++ ./src/key.c 2005-07-27 20:02:11.000000000 +0200 @@ -898,8 +898,21 @@ c = KEY_F (c - '0'); else if (c == ' ') c = ESC_CHAR; - else - c = ALT(c); + else { + switch (c){ + case '!': c = KEY_F(11);break; + case '@': c = KEY_F(12);break; + case '#': c = KEY_F(13);break; + case '$': c = KEY_F(14);break; + case '%': c = KEY_F(15);break; + case '^': c = KEY_F(16);break; + case '&': c = KEY_F(17);break; + case '*': c = KEY_F(18);break; + case '(': c = KEY_F(19);break; + case ')': c = KEY_F(20);break; + default: c = ALT(c);break; + } + } pending_keys = seq_append = NULL; this = NULL; --- ./src/main.c.org 2005-07-27 20:02:36.000000000 +0200 +++ ./src/main.c 2005-07-27 20:09:55.000000000 +0200 @@ -222,6 +222,12 @@ are tagged files */ int confirm_view_dir = 0; +/* Command prompt type: 0=no_prompt 1=CWD 2=get_from_subshell */ +int command_prompt_type = 2; + +/* Allow subshell to change MC's CWD */ +int allow_subshell_chdir = 1; + /* This flag indicates if the pull down menus by default drop down */ int drop_menus = 0; @@ -428,12 +434,13 @@ void do_possible_cd (const char *new_dir) { - if (!do_cd (new_dir, cd_exact)) - message (1, _("Warning"), - _(" The Commander can't change to the directory that \n" - " the subshell claims you are in. Perhaps you have \n" - " deleted your working directory, or given yourself \n" - " extra access permissions with the \"su\" command? ")); + if (!allow_subshell_chdir) return; + if (!do_cd (new_dir, cd_exact)) + message (1, _("Warning"), + _(" The Commander can't change to the directory that \n" + " the subshell claims you are in. Perhaps you have \n" + " deleted your working directory, or given yourself \n" + " extra access permissions with the \"su\" command? ")); } void @@ -704,9 +711,19 @@ if (current_dlg == midnight_dlg && command_prompt) { int prompt_len; - prompt = strip_ctrl_codes (subshell_prompt); + if(command_prompt_type==0){ + prompt = (geteuid () == 0) ? "# " : "$ "; + } else + if(command_prompt_type==1) { + prompt = current_panel->cwd; + } else + if(command_prompt_type==2) { + prompt = strip_ctrl_codes (subshell_prompt); + } else + prompt = "C:\\> "; prompt_len = strlen (prompt); - + if(command_prompt_type==1) ++prompt_len; + /* Check for prompts too big */ if (COLS > 8 && prompt_len > COLS - 8) { prompt[COLS - 8] = 0; @@ -866,7 +883,7 @@ {' ', N_("&Quick cd M-c"), 'Q', quick_cd_cmd}, {' ', "", ' ', 0}, {' ', N_("select &Group M-+"), 'G', select_cmd}, - {' ', N_("u&Nselect group M-\\"), 'N', unselect_cmd}, + {' ', N_("u&Nselect group M--"), 'N', unselect_cmd}, {' ', N_("reverse selec&Tion M-*"), 'T', reverse_selection_cmd}, {' ', "", ' ', 0}, {' ', N_("e&Xit F10"), 'X', quit_cmd} @@ -1271,6 +1288,7 @@ /* To access the directory hotlist */ {XCTRL ('\\'), quick_chdir_cmd}, + {ALT('\\'), quick_chdir_cmd }, /* Suspend */ {XCTRL ('z'), suspend_cmd}, --- ./src/screen.c.org 2005-07-27 20:10:16.000000000 +0200 +++ ./src/screen.c 2005-07-27 20:11:19.000000000 +0200 @@ -2130,7 +2130,7 @@ { ALT('u'), directory_history_next }, { ALT('+'), cmd_select }, { KEY_KP_ADD, cmd_select }, - { ALT('\\'), cmd_unselect }, +// { ALT('\\'), cmd_unselect }, { ALT('-'), cmd_unselect }, { KEY_KP_SUBTRACT, cmd_unselect }, { ALT('*'), cmd_reverse_selection }, --- ./src/setup.c.org 2005-07-27 20:12:15.000000000 +0200 +++ ./src/setup.c 2005-07-27 20:32:01.000000000 +0200 @@ -62,6 +62,11 @@ extern int num_history_items_recorded; +extern int subshell_blocks_ctrlo; +extern int command_prompt_type; +extern int allow_subshell_chdir; +extern int op_beep_when_finished; + char *profile_name; /* .mc/ini */ char *global_profile_name; /* mc.lib */ @@ -128,6 +133,7 @@ { "xterm_title", &xterm_title }, { "output_lines", &output_lines }, { "command_prompt", &command_prompt }, + { "command_prompt_type", &command_prompt_type }, { "menubar_visible", &menubar_visible }, { "show_mini_info", &show_mini_info }, { "permission_mode", &permission_mode }, @@ -159,6 +165,7 @@ { "confirm_execute", &confirm_execute }, { "confirm_exit", &confirm_exit }, { "safe_delete", &safe_delete }, + { "beep_when_finished", &op_beep_when_finished }, { "mouse_repeat_rate", &mou_auto_repeat }, { "double_click_speed", &double_click_speed }, #ifndef HAVE_CHARSET @@ -183,6 +190,8 @@ { "alternate_plus_minus", &alternate_plus_minus }, { "only_leading_plus_minus", &only_leading_plus_minus }, { "show_output_starts_shell", &output_starts_shell }, + { "allow_subshell_chdir", &allow_subshell_chdir }, + { "subshell_blocks_ctrlo", &subshell_blocks_ctrlo }, { "panel_scroll_pages", &panel_scroll_pages }, { "xtree_mode", &xtree_mode }, { "num_history_items_recorded", &num_history_items_recorded }, --- ./src/subshell.c.org 2005-07-27 20:33:40.000000000 +0200 +++ ./src/subshell.c 2005-07-27 20:39:59.000000000 +0200 @@ -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,14 +995,25 @@ exit (1); } - for (i = 0; i < bytes; ++i) - if (pty_buffer[i] == subshell_switch_key) { - write (subshell_pty, pty_buffer, i); - if (subshell_ready) - subshell_state = INACTIVE; - return TRUE; - } - + 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); + if (subshell_ready) + subshell_state = INACTIVE; + return TRUE; + } + } write (subshell_pty, pty_buffer, bytes); subshell_ready = FALSE; } else {