mordak / Term48

50 stars 20 forks source link

Future Hub integration #23

Open ardangelo opened 7 years ago

ardangelo commented 7 years ago

So I've done some experiments and found that it's possible to hook dynamically-loaded system calls on QNX using LD_PRELOAD, same as Linux. This means that we can present a virtual file system to whatever programs we wish, completely in user space. Specifically, we can use arbitrary BlackBerry-specific app functions to abstract OS features such as the Hub into a file system. echo Hello World > /hub/sms/+15558675309 sound appealing? Or perhaps tar -cz /hub/mail/gmail | gpg -c -o email.tgz.gpg? Just wondering what your thoughts are on this @mordak; though it would be a bit labor-intensive I think it would be a really unique feature for Term48.

mordak commented 7 years ago

I certainly don't object to such a thing - I have got inquiries about how to access messages and such from the terminal. It may also be fruitful to just write command line apps to access the various BB10 features, which could be reused in other environments. Grafting into the filesystem is a more unixy interface though, and opens up interesting possibilities like you suggest.

I think the sanest place to do this would actually be in mksh, which is the shell that Term48 is using under the hood. The terminal emulator doesn't really know anything about the file system at all, and just passes input to the shell and interprets the command sequences it gets back. mksh is doing all the interaction with the file system, so would have to know about presenting /hub as a virtual mount point.