TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Improvements to Completion and FIFOs

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
LokiChaos



Joined: 27 Oct 2009
Posts: 61

PostPosted: Fri Feb 24, 2012 2:28 pm    Post subject: Improvements to Completion and FIFOs Reply with quote

How about a more bash/zsh-like command completion? You can define root commands (akin to whatever is in $PATH) and standard arguments to each command, eg:

#tab {cast} {fireball, 'cure light', sleep, 'cure blindness'};

then if you do c[TAB] it will cycle through auto complete entries starting with c, if you keep cast, press space, then s[TAB] it would autocomplete sleep. If there are no matches, of if it has cycled through them then it can start pulling from the scrollback.

This would make tab-completion vastly more powerful.

Or a more simple request, if it is not already possible, can tab completion pull from command history as well as the main buffer?




Another request is support for fifo's. I know there are provisions for one tt++ session to interact with another, but I was thinking of something more flexible. fifo nodes could be useful.

Basic syntax: #fifo {type} {path}

type can be input or output, path is the path to the fifo node. you can #kill fifo {path} to remove a fifo

tintin would read from input fifos and treat them as entered commands.
eg: echo "look north" > ~/tintin.in

tintin would send output from the game/anything that appears in the buffer to the output fifo.
eg: cat tintin.out | grabURLs.pl > urls.log

This also would allow for more complex things like cat tintin.out | somescript > tintin.in which would let you use basically use anything that can handle streams or read/write to fifos. This is more flexible than #script/#run/#system or using #read to pull the output of a file.

Output support is easy, I think it would be basically just logging to a fifo instead of a normal file. Input fifos might be a little trickier.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Fri Feb 24, 2012 8:05 pm    Post subject: Reply with quote

Not really in the mood to mess with tab completion.

I'm not a fan of the fifo idea, but you can tail a file with #run {name} {tail -f <filename>} and set up triggers to do something with it.
Back to top
View user's profile Send private message Send e-mail
LokiChaos



Joined: 27 Oct 2009
Posts: 61

PostPosted: Fri Feb 24, 2012 11:48 pm    Post subject: Reply with quote

I understand not wanting to mess with tab completion, bash/zsh completion is quite complex (also why it's rather slow in bash/zsh).


I think I might write my own patch for fifo, at least for an input fifo. For output fifo's I can probably just use #log to an existing fifo and let things read from that. I want to be able to have external scripts be able to push commands rather than just have a #ticker poll for commands in a file queue.

I have a system somewhat like that now where I have tintin++ call a script that writes commands to a temp file, then tintin++ does a #read to execute them, then deletes the temp file, but this isn't very elegant method of IPC. I was thinking that fifo's would provide a good method of IPC for things like GUIs and other persistent programs that have their own event loops.

Edit: I will also need to find a solution for output, as #log append output.fifo crashes tintin++ when other processes stop reading form it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group