sebastinas/yafc — pull request #13 by TheJosh (2012-04-24 14:13:49+00:00)
Title: Support for replacements for args in shell commands

I found this in a comment above cmd_shell, and thought it might be a good idea.

So,
%h becomes the current hostname,
%p the port number,
%u the username, and
%d the remote directory

Example:
! whois %h

Which would be more use as an alias (I haven't actually tested as an alias, but should work).

There is a known bug in there if you have very long path or hostnames(>100) where the string length calc might be incorrect. It's fixable, I just haven't done it yet.