V9 RS Regression: CommandHistory method

Hi @Dale,

It looks like in V9 the CommandHistory method ignores everything that gets printed to command line by the commands. Before we were able to capture all printed, in V9 its just the main command name. This breaks a lot of scripts we had running in previous Rhino versions.

You can test this in V9 vs older versions:

Option Explicit

Call Main()
Sub Main()

	Call Rhino.ClearCommandHistory()
	Call Rhino.Command("-What _HistoryWindow")

	'reading command history window content
	Dim strHistory : strHistory = Rhino.CommandHistory()
	
End Sub

Thanks - https://mcneel.myjetbrains.com/youtrack/issue/RH-99804

– Dale

Hey @Jarek,

Thanks for reporting the issue. However, I’m unable to replicate it on my end. Can you please run the attached script and send the output .txt file (it is a modified version of your script)? It would also be helpful if you ran the _SystemInfo command so and paste that here so I know your machine details.

CommandHistoryCheck.rvb (4.2 KB)

Thanks!
Curtis.

Hi @curtisw,

Thanks for testing it. I think I found the problem or what has changed. The multiple lines in the single history string used to be separated by chr(13), and in BETA they are separated by chr(10).

So in order to get the history lines array, we used to do:

Dim arrTxtLines : arrTxtLines = Rhino.Strtok(strHistory, chr(13))

and it BETA, it needs to be:

Dim arrTxtLines : arrTxtLines = Rhino.Strtok(strHistory, chr(10))

That’s why in the old debugger I could see:
image

And in BETA in debugger I see only:
image

even though its all there, but split into multiple lines differently.

Now, this breaks a bunch of older scripts and plugins relaying on the chr(13) separation. Do you think we could have it back the old way?

thanks!

–jarek

Hey @Jarek, that makes much more sense, good catch!

This is definitely something that can be fixed up on our end.