Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    "but have not been able to succeed" is not very informative. Did you get an error message? What did you expect to happen? How did what actually happened differ from what you expected? Is tocb executable (i.e. you've run chmod +x on it). Is it in a directory listed in $PATH? Does it run and do what you expect when you pipe data into it from the shell? Have you tried binding it to a different key? (some programs and some terminals intercept things like ^c, which is commonly used to interrupt/kill a process or to copy data into the clipboard) Commented Jul 21 at 13:18
  • 2
    I'm glad it's obvious to you because you have knowledge about these built-in nano functions. good luck with that. Commented Jul 21 at 15:05
  • 1
    if it's obviously wrong to you, @MrCalvin, why include it in the question? That's called a "red herring", because it leads readers on a wild (and time-wasting) hunt (for a nonexistant animal or solution). It certainly did for me. Commented Jul 21 at 15:09
  • BTW, after some testing, it seems that if you rebind ^C, nano exits with error message No key is bound to function 'Cancel' in menu 'yesno'. Exiting. so OP would have to bind something else to that function in order to rebind ^C - which is a bad idea, IMO. I had no problem binding Alt-O (which is one of the key combinations that nano doesn't currently use): bind M-O "{execute}|cat -n^M" main. That ^M is a literal carriage return, don't think you can enter that in nano. I used ^V^M in vim, could also do something like printf 'bind M-O "{execute}|cat -n\r" main' >> ~/.nanorc in bash. Commented Jul 21 at 15:38
  • I guess knowledge about these built-in nano functions isn't necessary after all, just the standard diagnostic process like I was trying to get him to engage with. I never use nano but I managed to figure it out in about 5 minutes just by skimming the man page and trying a few things. The only remaining question is whether the OP's tocb script actually works as a filter like cat does. Commented Jul 21 at 15:45