Clarify uses for results of `Get-PSReadLineOptions`

Aperta
#3,601 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp, powershell
Ambito
cli

Direzione di ricerca

Start by locating the implementation and output formatting for Get-PSReadLineOption, then compare it with the formatting used by Get-PSReadLineKeyHandlers. Determine how color-specific keys should be distinguished from other options and confirm whether the proposed presentation preserves existing behavior; done means the output clearly explains which keys Set-PSReadLineOption -Colors accepts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Issue-Enhancement
Prerequisites
  • Write a descriptive title.
Description of the new feature/enhancement

When I was exploring some of the coloring options available in PSReadLine I was confused when the options I got from Get-PSReadLine were not working when I did Set-PSReadLineOption -Colors @{<KEY>='Green'} . The options were expressed like "Color" but in order for them to work you just need "". An example of this confusion can be seen in screenshot below:

Screenshot 2023-02-27 at 2 33 06 PM

Proposed technical implementation details (optional)

Have more clear formatting to show the color options verses the other options available in PSReadLine, perhaps a header showing these are color specific keys. Maybe utilize the same formatting that Get-PSReadLineKeyHandlers use.

i.e

PS /Users/stevenbucher> Get-PSReadLineOption

Editmode
=======
Option                                  Value             Description
---                                    --------           -----------

EditMode                               : Emacs.           Some description

History Options
============

AddToHistoryHandler                    : System.Func`2[System.String,System.Object]
HistoryNoDuplicates                    : True
HistorySavePath                        : /Users/stevenbucher/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
HistorySaveStyle                       : SaveIncrementally
HistorySearchCaseSensitive             : False
HistorySearchCursorMovesToEnd          : False
MaximumHistoryCount                    : 4096

....

Color Options
==========

Option                                  Value             Description
---                                    --------           -----------
Command                           : "`e[93m"              PowerShell Cmdlets
Comment                           : "`e[32m"
ContinuationPrompt                : "`e[37m"
DefaultToken                      : "`e[37m"
Emphasis                          : "`e[96m"
Error                             : "`e[91m"
InlinePrediction                  : "`e[38;5;238m"
Keyword                           : "`e[92m"
ListPrediction                    : "`e[92m"
ListPredictionSelected            : "`e[48;5;238m"
Member                            : "`e[97m"
Number                            : "`e[97m"
Operator                          : "`e[90m"
Parameter                         : "`e[90m"
Selection                         : "`e[30;47m"
String                            : "`e[36m"
Type                              : "`e[37m"
Variable                          : "`e[92m"

Very rough design but just a thought for potential way to do this.

NOTE: this would be a breaking change so may not be worth however my personal preference is having more detailed and categorization of these options.

Lingua principale
C#
Stelle
4.4k
Fork
341
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/PSReadLine

Tutte le issue di PowerShell/PSReadLine

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.