mainThe GNU Readline library - Support: sr #111068, count in vi mode alters prompt

 
 

sr #111068: count in vi mode alters prompt

Submitter:  Mohamed Akram <mohdakram>
Submitted:  Mon 20 May 2024 02:39:07 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  2 - Minor Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 20 May 2024 02:39:07 PM UTC, original submission:  

Originally posted this as a bash bug but this behavior is implemented in readline itself so it's more fitting here.

When using vi mode, whenever a count is used before a command, readline replaces the prompt with (arg: n) where n is the count entered. This causes the entire line to shift, which is particularly jarring if a long prompt is used in a shell like bash, as is common. It should instead silently accept the count as it does any other input in command mode. This is how it behaves in other shells that implement vi mode including dash, zsh and ksh. There's also no mention of a prompt change in the POSIX spec regarding vi mode.

Replacing the prompt makes more sense in emacs mode to alert the user that a different mode has been entered. In vi mode, however, one is already in command mode when using a count so no further notification is needed.

Mohamed Akram <mohdakram>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56117:  patch-vi-count.diff added by mohdakram (881B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mohdakram (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-30 mohdakram Attached File- Added patch-vi-count.diff, #56117

    Back to the top

    Powered by Savane 3.13-c54d.
    Corresponding source code