bugGNU nano - Bugs: bug #28994, [Request] enable search (^W) in...


bug #28994: [Request] enable search (^W) in help (^G)

Submitted by:  None
Submitted on:  Tue Feb 23 22:03:28 2010  
Severity: 3 - NormalStatus: In Progress
Assigned to: NoneOpen/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sat Nov 12 17:12:46 2016, comment #4:

Rishabh is getting closer to the target. See

Benno Schulenberg <bens>
Project Administrator
Wed Oct 19 19:53:38 2016, comment #3:

The second version (write the help text to a file and open it with another nano) works fine, but... as you said, it is wasteful. And I don't see how you can prevent the user from typing ^G again which would open another nano... So this is off.

The first version didn't compile for me, but after a slight tweak it did, but... I couldn't figure out how to search in the help text -- ^W doesn't work, nor /. So... what? Also, looking at the patch... you add a lot of code. But what I expected to happen is: write the help text to a temp file instead of into a giant string in memory, then read in this temp file into a new buffer (as if having typed ^R and M-F), so the user can simply use ^W and M-W to search for things. (Probably view mode will have to become a per-file attribute, but that is a later refinement.)

So, there shouldn't be any new menu or search code or anything. After the call of help_init(), write out the giant string to a secure temp file (not a file with a fixed name). Then read that file into a new buffer and switch to it. Done. No more is needed.

Benno Schulenberg <bens>
Project Administrator
Wed Oct 19 17:03:39 2016, comment #2:

Since TODO confirms we want a search, I tried implementing this feature and have come across 2 techniques for same solution: (i) Print the help text in a file and running search on it and then map the position on the screen (of string when found). (ii) Print the help text in a file and open it in a (sub-)instance of nano.

While former one is tedious, latter is inefficient - would consume almost twice the memory. Also, latter leads to noticeable lag when user would do ^G (actually, former does it too but it is negligible.)

Patches for both of these are attached. They are only to confirm that both of them are feasible solution. They are not complete; solution is not fully implemented, they have dead code and are buggy.

First solution - https://savannah.gnu.org/bugs/download.php?file_id=38762

Second solution - https://savannah.gnu.org/bugs/download.php?file_id=38763

Rishabh Dave <prongs>
Sat Jun 14 16:32:32 2014, comment #1:

Yes, a searchable help text would be nice. But the simple solution is not possible: the help text is generated dynamically, to take key rebindings into account.

Benno Schulenberg <bens>
Project Administrator
Tue Feb 23 22:03:28 2010, original submission:

when i enter help (with ^G) i can't use search in it to search for desired key (using ^G). please add this feature...

simplest way is to have help in some read-only file in /usr/share/doc and open it in another (sub)instance of nano.

system("nano --view /usr/share/doc/help.txt");



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

Attach File(s):


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by prongs (Updated the item)
  • -unavailable- added by bens (Posted a comment)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Nov 12 17:12:46 2016bensStatusNone=>In Progress
    Wed Oct 19 16:58:27 2016prongsAttached File-=>Added 0001-feature-add-search-facility-to-help-Search-and-map.patch, #38762
      Attached File-=>Added 0001-feature-add-search-facility-to-help-Through-subinstance.patch, #38763
    Sat Jun 14 16:32:32 2014bensSummary[Feature request] Enable search [^W] in help [^G]=>[Request] enable search (^W) in help (^G)

    Back to the top

    Powered by Savane 3.1-cleanup