62

I find really annoying to use Midnight Commander under OS X when using the non-extended keyboard (laptop).

I found no way of simulating an INSERT key press (select file) and I would like to find a solution that does not require me to reconfigure MC, specially because I cannot do this with each machine I'm connecting to from my MacBook.

I will give extra bonus ;) for and extended solution what will solve the problem not only for the INSERT (select file) but also for switch selection and add/substract selection (NumMultiply,NumMinus,NumPlus).

Remember that Numlock area *, + and - are not the same as the ones from the standard keyboard.

jhabbott
  • 831
sorin
  • 29,875

7 Answers7

85

Ctrl+T is standard hotkey for file selection — http://linux.die.net/man/1/mc.

As for switch/add/substract, just type Shift+8 for *, Shift+= for + and - for minus.

All this works in MC out of the box.

Pro Backup
  • 3,916
Eugene Bujak
  • 1,835
  • ^T works but the others do not and I tried to use an external keyboard and when I press *, + or - from the keypad it will work. – sorin Apr 04 '11 at 13:32
  • That's strange. Works for me though (with iTerm2). What happens then? Make sure your command line is clear when you do that. – Eugene Bujak Apr 04 '11 at 13:51
  • Interesting, I am also using iTerm2 and pressing the keypad *-+ it doesn't bring the selection window. – sorin Apr 04 '11 at 15:00
  • That's all I can help you with, unfortunately. – Eugene Bujak Apr 05 '11 at 12:39
  • I have problem to prevent Unselect dialog when pressing minus, did anyone solve this https://apple.stackexchange.com/questions/337008/how-to-avoid-unselect-file-dialog-when-pressing-minus-sign-in-midnight-commander ? – brablc Sep 20 '18 at 11:31
4

Holding shift ⇧ while pressing or will also select the file.

Shift ⇧ + is easier for me to reach and skip over files I don't want to select compared to Control ⌃ + t.

Edd Growl
  • 2,684
  • Doesn't work for me. – Sergey Kirienko Mar 08 '21 at 18:04
  • 2
    @SergeyKirienko I guess you're using the native OSX Terminal app? There's something about the native Terminal app that doesn't send Shift + Arrow keystrokes correctly (probably you need to fiddle with some settings in Terminal or in OSX System Preferences). You might want to try iTermlink . iTerm works out of the box with Shift + Arrow. I've tried the above Shift + Arrow and it works locally (with homebrew version of mc) and also through SSH/mosh/tmux. – slackair Mar 15 '21 at 02:46
3

For those like me who were drawn here by a Google search based on the title of the question (not relating to Midnight Commander), I still haven't found a great solution. However, for Word processors (a common usage of needing to find the "insert" key to toggle Insert/Overwrite mode), you should be able to click the text that says "INSRT" or "OVER"/"OVWT" in the status bar on the bottom of the Word Processor to change modes, as detailed here for Open Office. Not awesome, but at least functional.

If neither Midnight Commander nor a Word Processor drew you here, then...good luck in your quest!

3

As @slackair has suggested to use a convenient combination

Holding shift ⇧ while pressing ↑ or ↓ will also select the file.

However, this does not work out of the box in Mac Terminal, but you can setup a key to action mapping in your profile keyboard settings as following:

Shift ⇧ + ↑ to \033[1;2A
Shift ⇧ + ↓ to \033[1;2B

Screenshot of Profiles dialog

Greenonline
  • 2,004
Cmyker
  • 131
1

For those who want to select all files: first press Shift++ - Midnight Commander will prompt for a selection options (* by default), then just hit Enter - works fine in Terminal.app

art_hq
  • 11
0

I use iTerm2. IMHO Midnight Commander with iTerm2 works better. https://iterm2.com/

brew install iterm2
tsyma
  • 1