BUG: AROS Shell handles alias definition different

amiga23 · 571

amiga23

  • Newbie
  • *
    • Posts: 22
    • Karma: +1/-0
on: November 17, 2019, 03:59:04 PM
Alias cls "echo *"*e[0;0H*e[J*""
does not work "Alias: argument line invalid or too long"

Alias cls echo "*e[0;0H*e[J"
Alias baum "echo *"BAUM*""
Work fine



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +2/-0
Reply #1 on: November 18, 2019, 03:45:12 PM
i dont understand this one. i know very little of amiga dos and c commands. what is expected behaviour?

btw. thx for reporting, stuff like that may prove useful, and after we have a well described issue i can open one on aros-development-team github repo.



amiga23

  • Newbie
  • *
    • Posts: 22
    • Karma: +1/-0
Reply #2 on: November 19, 2019, 08:58:11 PM
I try to explain how I understand it.

I did not create the example myself, but it is working on AMIGA OS.

echo "*e[0;0H*e[J"

Should clear the CLI/Shell/CON window.

Alias is used to set alias commands.

alias cls "echo *"*e[0;0H*e[J*""

should create the alias "cls". So if you type cls the Window should be cleared and prompt should be top left.

*" can be used to have " in ".

echo "Hello World" -> alias helloworld "echo *"Hello World*""

This works fine in AROS till this point.

But putting escape sequences into the game, will cause the parser in AROS alias to fail:
echo "*e[0;0H*e[J" -> alias cls "echo *"*e[0;0H*e[J*"" => alias: argument line invalid or too long

but AROS and AMIGA OS accept:
alias cls echo "*e[0;0H*e[J"

So this is not a big issue. I do not insist in fixing this. This is just what I found, while testing things. Every time I opened a new shell I got an error on AROS, because of the shell-startup of the examples I was testing.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +2/-0
Reply #3 on: November 20, 2019, 12:20:05 PM
okay so its about the escape character *
now thats a bit more clear.
seems aros implements this but the behaviour isnt the same in every case.
i still dont understand very well the particular example "*e[0;0H*e[J*""
do you have any link where these escape sequences are explained?
are there other examples, particularly simpler ones where it doesnt work?