Skip to content

Fix for trace output command detection

Compare
Choose a tag to compare
@9seconds 9seconds released this 06 Nov 20:40
· 45 commits to master since this release

This release fixes potentially tricky situation (or at least, tries to fix) when ah is unable to detect which command it should use to refer output. It can happen only if you execute a lot of commands simultaneously (starting tmuxinator for example) but it cannot cover all possible cases without intergration into shell.

Why is it so hard and patch may looks fishy? Basically, the reason is simple: command you are going execute and command in history is not the same. Do you love $() or backticks? This is a reason why it can fail.

Let's say, you execute the command ah t -- $(/usr/bin/env python) bootstrap.py. Okay, history will store this line. But naturally, shell gives ah ah t -- /usr/bin/python bootstrap.py. See the difference?

ah is not precise here also: the root cause is... shell again. All shells store unix timestamps which are seconds but not nanoseconds. So if you've executed 10 ssh git@github.com in one seconds, it is impossible to detect what command do we need to bind to.

But these cases are pretty rare. In most cases everything should work.