Re: [Fish-users] Immediate feedback in terminal applications
Hi Bert, There's no magic function here - it is old-fashioned ANSI escapes. In essence: - Output the text that's been typed - Output the escape code to make the text gray - Output the suggestion - Use cursor motion escapes to move the cursor back to the end of the text fish's implementation of this stuff is in reader.cpp Hope that helps, _fish On May 5, 2013, at 12:07 AM, Bert wrote: > Hi, I apologize in advance because this question is off-topic, but how does > fish-shell do the immediate update of the terminal for per-character feedback > for the user? > > To be more specific, what C function or library might I use to implement a > predictive autocomplete for a user without requiring them to hit the TAB key? > > I am trying to figure out how to implement the same kind of > typeahead/autocomplete in another command-line application I am working on. > > Thanks so much in advance. > > Sincerely, > Bert -- Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may ___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users
Re: [Fish-users] Immediate feedback in terminal applications
Try this? https://github.com/fish-shell/fish-shell/blob/master/complete.cpp On May 5, 2013, at 3:07 AM, Bert wrote: > Hi, I apologize in advance because this question is off-topic, but how does > fish-shell do the immediate update of the terminal for per-character feedback > for the user? > > To be more specific, what C function or library might I use to implement a > predictive autocomplete for a user without requiring them to hit the TAB key? > > I am trying to figure out how to implement the same kind of > typeahead/autocomplete in another command-line application I am working on. > > Thanks so much in advance. > > Sincerely, > Bert > -- > Get 100% visibility into Java/.NET code with AppDynamics Lite > It's a free troubleshooting tool designed for production > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap2___ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users -- Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2___ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users