mainThe GNU Bourne-Again SHell - Support: sr #109610, Add vi-mode prompt escape code

 
 

sr #109610: Add vi-mode prompt escape code

Submitter:  Danny Colin <dannycolin>
Submitted:  Sun 30 Dec 2018 03:11:25 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  Wont Do
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 04 Feb 2019 11:29:38 PM UTC, comment #3: 

Hi Chet,

Just to clarify all the custom mode string logic is in readline.  The bash repo exists purely for convenience to build against the custom readline (it brings it in as a git submodule).  The patched version of readline is here:  https://github.com/calid/readline

The logic behind expanding the mode string escape is here:
https://github.com/calid/readline/blob/de57f1570204836db26eec33d826cefce092584c/display.c#L261

And the actual '\m' escape is defined here:
https://github.com/calid/readline/blob/de57f1570204836db26eec33d826cefce092584c/rlconf.h#L58

Does this change your opinion about accepting this functionality?

Thanks,
Dylan

Dylan Cali <calid>
Fri 01 Feb 2019 04:04:51 PM UTC, comment #2: 

Well there's still the problem of having it hard coded in the front of the prompt line. I think it is totally logical to have the option of moving it where ever the user want in the prompt.

Instead of tagging it as "won't do" could we at least consider thinking about a way to implement that option in a manner that won't put the abstraction in the wrong place.

If you prefer that I open an issue on readline instead of bash, please let me know.

Danny Colin <dannycolin>
Fri 01 Feb 2019 03:18:58 PM UTC, comment #1: 

I don't like this because it puts the abstraction in the wrong place. The indicator should be part of readline, not one of the special bash prompt expansions, because readline needs to change it dynamically -- like when switching between vi command and insert modes.

Chet Ramey <chet>
Group administrator
Sun 30 Dec 2018 03:11:25 AM UTC, original submission:  

Version:

4.4.12

What behaviour you see:

At the moment, I can only have the vi-mode string at the beginning of my prompt

What behaviour you expect to see:

I'd like to be able to move it where ever I want in my custom PS1 prompt by using an escape code like I do with \w (path name).

Note:

I've found that someone I've made a patch for it https://github.com/calid/bash but I think it'd be nicer to have that builtin in the official release.

Best regards,

Danny Colin <dannycolin>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by calid (Posted a comment)
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by dannycolin (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
    2019-02-01 chet StatusNone Wont Do

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code