@@ -413,15 +413,46 @@ type ReadLineConsole(complete: (string option * string -> seq<string>)) =
413413(! anchor) .PlaceAt( x.Inset,! rendered);
414414 change()
415415| _ ->
416- // Note: If KeyChar=0, the not a proper char, e.g. it could be part of a multi key-press character,
417- // e.g. e-acute is ' and e with the French (Belgium) IME and US Intl KB.
418- // Here: skip KeyChar=0 (except for F6 which maps to 0x1A (ctrl-Z?)).
419- if key.KeyChar<> '\000 '|| key.Key= ConsoleKey.F6then
420- insert( key);
421- change()
422- else
423- // Skip and read again.
424- read()
416+ match ( key.Modifiers, key.KeyChar) with
417+ // Control-A
418+ | ( ConsoleModifiers.Control, '\001 ') ->
419+ current:= 0 ;
420+ (! anchor) .PlaceAt( x.Inset, 0 )
421+ change()
422+ // Control-E
423+ | ( ConsoleModifiers.Control, '\005 ') ->
424+ current:= input.Length;
425+ (! anchor) .PlaceAt( x.Inset,! rendered)
426+ change()
427+ // Control-B
428+ | ( ConsoleModifiers.Control, '\002 ') ->
429+ moveLeft()
430+ change()
431+ // Control-f
432+ | ( ConsoleModifiers.Control, '\006 ') ->
433+ moveRight()
434+ change()
435+ // Control-P
436+ | ( ConsoleModifiers.Control, '\020 ') ->
437+ setInput( history.Previous());
438+ change()
439+ // Control-n
440+ | ( ConsoleModifiers.Control, '\016 ') ->
441+ setInput( history.Next());
442+ change()
443+ // Control-d
444+ | ( ConsoleModifiers.Control, '\004 ') ->
445+ raise<| new System.IO.EndOfStreamException()
446+ | _ ->
447+ // Note: If KeyChar=0, the not a proper char, e.g. it could be part of a multi key-press character,
448+ // e.g. e-acute is ' and e with the French (Belgium) IME and US Intl KB.
449+ // Here: skip KeyChar=0 (except for F6 which maps to 0x1A (ctrl-Z?)).
450+ if key.KeyChar<> '\000 '|| key.Key= ConsoleKey.F6then
451+ insert( key);
452+ change()
453+ else
454+ // Skip and read again.
455+ read()
425456
426457and change () =
427458 changed:= true ;