anarkila / DeveloperConsole

Developer Console for Unity
MIT License
36 stars 1 forks source link

Using previous command (arrow up) will not show the last sent autofill command, and wont keep args #5

Closed ndumais closed 1 year ago

ndumais commented 1 year ago

So there's two things, if it's an auto-fill command, it doesn't seem to get added to the previous command list. Which is a common behaviour in Linux and most consoles, afaik. Also, the previous command wont keep it's arguments, which is also the expected behaviour.

I tried playing around with the code a bit, but for things like that, I don't understand the architecture enough to fix things like this.

Happy to see the project is still maintained a bit, cause it's great overall, I've waited way too long to add something like this to my project!

anarkila commented 1 year ago

Also, the previous command wont keep it's arguments, which is also the expected behaviour.

Fix in Dev branch https://github.com/anarkila/DeveloperConsole/commit/696a92e3b3c4069d9d32d256108324ace313df12

if it's an auto-fill command, it doesn't seem to get added to the previous command list. Which is a common behaviour in Linux and most consoles, afaik.

Added new option to allow keeping track of duplicate commands. Default behaviour is false, same type of behaviour as in most other consoles https://github.com/anarkila/DeveloperConsole/commit/5de8f8f67bc605d3cb4acf61541cfe5d22339789

ndumais commented 1 year ago

Default behaviour is false, same type of behaviour as in most other consoles

Tested with your new changes and things feel mostly normal now (without the duplication thing). The issue is not with duplication but that if you use arrow up to get the previous command, and then do it again, the command shown is another one.

Example:

'help' (enter) 'a console command' (enter) pressing arrow up and then enter on 'a console command' pressing arrow up again <-- where behaviour stops being as expected it will show 'help' instead of 'a console command' expected behaviour would be seeing 'a console command' but without duplication in other words, arrow up should always bring back the last executed command first, and never one executed prior to it tested in cmd to confirm the expected behavior

so it might just have to do with the ordering?

anarkila commented 1 year ago

I pushed two new commits https://github.com/anarkila/DeveloperConsole/commit/4c7f972ed1f30a348e74eb098719864d60359ab6 https://github.com/anarkila/DeveloperConsole/commit/5b9a74102be55102ddef1c098481259d0653ea77 to Dev branch to fix this. It was indeed ordering issue.

Also now there's option to keep track of failed/non-existing commands just like cmd/terminal does. This behaviour is on by default.