@@ -78,6 +78,10 @@ public class PSConsoleReadLineOptions
7878 public const ConsoleColor DefaultEmphasisColor = ConsoleColor . Cyan ;
7979 public const ConsoleColor DefaultErrorColor = ConsoleColor . Red ;
8080
81+ // Use dark black by default for the suggestion text.
82+ // Find the most suitable color using https://stackoverflow.com/a/33206814
83+ public const string DefaultPredictionColor = "\x1b [38;5;238m" ;
84+
8185 public static EditMode DefaultEditMode = RuntimeInformation . IsOSPlatform ( OSPlatform . Windows )
8286 ? EditMode . Windows
8387 : EditMode . Emacs ;
@@ -407,6 +411,12 @@ public object SelectionColor
407411 set => _selectionColor = VTColorUtils . AsEscapeSequence ( value ) ;
408412 }
409413
414+ public object PredictionColor
415+ {
416+ get => _predictionColor ;
417+ set => _predictionColor = VTColorUtils . AsEscapeSequence ( value ) ;
418+ }
419+
410420 internal string _defaultTokenColor ;
411421 internal string _commentColor ;
412422 internal string _keywordColor ;
@@ -421,6 +431,7 @@ public object SelectionColor
421431 internal string _emphasisColor ;
422432 internal string _errorColor ;
423433 internal string _selectionColor ;
434+ internal string _predictionColor ;
424435
425436 internal void ResetColors ( )
426437 {
@@ -438,6 +449,7 @@ internal void ResetColors()
438449 MemberColor = DefaultNumberColor ;
439450 EmphasisColor = DefaultEmphasisColor ;
440451 ErrorColor = DefaultErrorColor ;
452+ PredictionColor = DefaultPredictionColor ;
441453
442454 var bg = Console . BackgroundColor ;
443455 if ( fg == VTColorUtils . UnknownColor || bg == VTColorUtils . UnknownColor )
@@ -473,7 +485,8 @@ internal void SetColor(string property, object value)
473485 { "Type" , ( o , v ) => o . TypeColor = v } ,
474486 { "Number" , ( o , v ) => o . NumberColor = v } ,
475487 { "Member" , ( o , v ) => o . MemberColor = v } ,
476- { "Selection" , ( o , v ) => o . SelectionColor = v } ,
488+ { "Selection" , ( o , v ) => o . SelectionColor = v } ,
489+ { "Prediction" , ( o , v ) => o . PredictionColor = v } ,
477490 } ;
478491
479492 Interlocked . CompareExchange ( ref ColorSetters , setters , null ) ;
0 commit comments