It somehow has something to do with what was recently done. This is strange!
I have a button, "test", which sends the following to the current tab.
esc "echo %%@quote[%_selected]" enter
The attached batch file should work for anyone, and produce a list of the temperatures in Syracuse, NY for each of the last 24 hours plus the average. There's nothing peculiar in it. Run it, then select one line of its output, the button will fail as Jay described. After that the button will work as expected. Run the BTM again and the button will fail (again only once).
Here's the result of running the BTM, selecting its last output line and pressing the button ... then selecting the same line and pressing the button again.
I'm glad you were able to reproduce the problem. I was beginning to think I was losing my mind.
I just installed TCMD19 on another computer, and it was working fine there. On my main computer, I could not get it to recover until I rebooted. Now %_selected is working again. I'll have to watch and try to determine what I did to make it stop.
It may be a problem related to piping. The same thing happens with the command lines
echo abc def | type
echo abc def | view
Now, when this first happened to me, %_selected stopped working permanently, and only a reboot restored proper operation. So I must have done something else. I don't think that I am using piping in my aliases or scripts, and I certainly did not do it manually.
The %_selected expansion occurs inside TCMD, not TCC. TCMD is trying for a PID match on the console session, but the child pipe process breaks that when it does some IPC with TCMD and then disappears. If the parent TCC process then does some IPC, things get reset; otherwise TCMD doesn't know who's talking to it.
This is exactly the same behavior in every version of TCMD / TCC; the only difference will be in the timing of the IPC.
I might be able to work around it by forcing a dummy IPC after the child pipe process exits.
I'm back in the state where %_selected will not work at all, even after shutting down TCMD and starting it up again (even killing SHRALIAS, in case that had anything to do with it). I am unable to get things working except by rebooting the computer, which is a huge nuisance.
Unfortunately, I don't know what I did that may have precipitated the problem. Maybe I should turn on command logging so I can go back and look.
Well, I did turn on logging, and the problem did come back. I was logging only commands, not everything, but the variable returned a value in one command and failed in the next command. So it would appear that something I was doing outside of TCMD may have caused the problem to appear (though that seems to me hard to imagine). Now I'll try turning on logging of all activity (after rebooting) and see if something else was going on that did not get logged.
Ugh. I tried it once more before rebooting, and now it's working again! I wonder if perhaps the text that I had selected became unselected without my noticing.
I'm now having trouble with the LOG command. A new LOG command with different options is not superseding the previous command, and the log file does not contain the date stamp described in the help file. I'm going to reboot and start over.