Tasks Text Editor - lersek/edk2 GitHub Wiki

This task involves making several improvements for the standard shell text editor

Table of Contents

Status

Issues:
  • Plenty of wasted screen space
  • Unusual hot-keys
  • Hot-keys are not usable over a serial/network terminal connection
Nice to have:
  • Support terminal widths as narrow as 60 columns
Location of editor code: ShellPkg/Library/UefiShellDebug1CommandsLib/Edit

Development environment

Building

  • This project can be completed on any edk2 supported OS or toolchain.
Testing
  • This project can be tested on any PI 1.2 system.
  • OVMF, Nt32Pkg or UnixPkg could each provide friendly test environments.

Current State

Here is the current look of the UEFI Editor:

UEFI EDIT 2.0     NewFile.txt                                                   
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
                                                                                 
   Row: 1  Col: 1       0 Lines Read                            |INS|            
 F1  Go To Line      F2  Save File       F3  Exit                                
 F4  Search          F5  Search/Replace  F6  Cut Line                            
 F7  Paste Line      F8  Open File       F9  File Type                           

Suggested New Layout

Main window

UEFI EDIT 2.0     NewFile.txt                               
                                                            
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
 1,1                                            Help: Ctrl-? 

Editor Help

Ctrl-? should popup a help box, something like this:

UEFI EDIT 2.0     NewFile.txt                               
                                                            
  +-- Help --------------------------------------------+     
  | Ctrl-G, F1  Go To Line      Ctrl-S, F2  Save File  |     
  | Ctrl-Q, F3  Exit            Ctrl-F, F4  Search     |     
  | Ctrl-R, F5  Search/Replace  Ctrl-K, F6  Cut Line   |     
  | Ctrl-U, F7  Paste Line      Ctrl-O, F8  Open File  |     
  | Ctrl-T, F9  File Type                              |     
  +----------------------------------------------------+     
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
 1,1                                            Help: Ctrl-? 

Another option might be to display help as if it were a text file:

UEFI EDIT 2.0     (Editor Help)                             
Help                                                        
                                                             
 Control Key   Function Key   Command                        
 -----------   ------------   -----------------              
 Ctrl-G        F1             Go To Line                     
 Ctrl-S        F2             Save File                      
 Ctrl-Q        F3             Exit                           
 Ctrl-F        F4             Search                         
 Ctrl-R        F5             Search/Replace                 
 Ctrl-K        F6             Cut Line                       
 Ctrl-U        F7             Paste Line                     
 Ctrl-O        F8             Open File                      
 Ctrl-T        F9             File Type                      
 Ctrl-W                       Close File                     
                                                             
 Use Ctrl-W to exit this help                                
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
 1,1                                            Help: Ctrl-? 

Search

Ctrl-F should ask for text to find on the bottom line:

UEFI EDIT 2.0     NewFile.txt                               
                                                            
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
 Search for: UserEntersSearchTextHere                        

Search/Replace

Ctrl-R should ask for the seach/replace on the bottom line. First the search, then the replace text.

UEFI EDIT 2.0     NewFile.txt                               
                                                            
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
                                                             
 Replace with: UserEntersReplacementTextHere                 

See Also

⚠️ **GitHub.com Fallback** ⚠️