2012/12/28 ridiculous_fish <corydo...@ridiculousfish.com>:
> On Dec 21, 2012, at 10:15 AM, Cheer Xiao <xiaqq...@gmail.com> wrote:
>
>> 2012/12/19 ridiculous_fish <corydo...@ridiculousfish.com>:
>>> After running a command, some processing occurs on a background thread. 
>>> When that's done, it notifies the main thread, which adds the item to the 
>>> history. The earliest that the main thread can respond to the notification 
>>> is in its main "event loop", which is a call to select().  So the history 
>>> item only gets added after the next prompt is displayed.
>>>
>>
>> What's the motivation for using another thread for adding history?
>
> The motivation is as follows: when storing a history item, fish tries to 
> detect which arguments are valid file paths, and then only autosuggests the 
> command if those paths remain valid. For example, if you run "cat fish.cpp" 
> in the fish source directory, fish will notice that 'fish.cpp' is a valid 
> path. If you go to another directory, it won't autosuggest that command, 
> unless a fish.cpp happens to be in that directory too.
>
> Checking whether an argument is a valid path requires disk I/O that may be 
> slow (think NFS server), so it's done in a background thread.
>
> History is saved synchronously on the main thread. The history file lives in 
> your home directory, and home directories are typically fast to access, so 
> it's not as important to make that asynchronous. (However it would be nice to 
> make it so.)

Hm, if fish is already remembering filenames for auto-suggestion, it
might make sense to make the table available to shell scripts as well.
That will make implementing fasd a breeze. :)


--
Regards,
Cheer Xiao

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to