-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using ansi character codes for terminal emulator #2570
Comments
I've edited your post to format the code as bash script. Likely the part of Pi-Apps source code you were looking at was the first few functions in |
It was in etc/terminal-run
$ grep echo terminal-run
echo -e "\e[91m$1\e[39m"
commands="echo "\$""\$" > $temp_pid_file
commands="echo -ne '\e]0;${title}\a'
[ $DEBUG == 1 ] && echo "Default x-terminal-emulator: $terminal"
if [ ! -z "$terminal" ] && echo "$terminals" | grep -qFx "$terminal" ;then
[ $DEBUG == 1 ] && echo "Using $terminal"
[ $DEBUG == 1 ] && echo "Using $terminal"
konsole -e bash <(echo "$commands") &
qterminal -e bash <(echo "$commands") &
#echo "Waiting for terminal to close..."
Robert E. Novak
***@***.***
Philippines Cell +63 968 896 8851
USA Cell: +1 (408) 333-5488
Skype: sailnfool.ren
WhatsApp +639688968851
Linkedin: https://www.linkedin.com/in/sailnfool
Github: https://www.github.com/sailnfool
…On Tue, Apr 2, 2024 at 12:40 PM Botspot ***@***.***> wrote:
I've edited your post to format the code as bash script.
Likely the part of Pi-Apps source code you were looking at was the first
few functions in api. Is that correct? Specifically, was it the
generate_logo function, the error function, the status and status_green
functions?
Or was there some other place where you saw unknown ansi escape codes?
—
Reply to this email directly, view it on GitHub
<#2570 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVDTKLXUKBJQJ4HKAM3Z53Y3IZEJAVCNFSM6AAAAABFSTVJL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZRGA3TEMBZGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Lines 24 to 25 in f86137e
Lines 11 to 14 in f86137e
|
Cool ideas?
Reading your source code, it is difficult to intuitively know the meaning of the various ansi codes that are used for clearing the screen, changing colors of output, etc.
I suggest using mnemonic names that are self-explanatory to describe the codes as Bash variables. I realize that this has a minuscule effect on Bash processing speeds to build the internal lookup tables, but it makes the challenge of maintaing the code simpler.
Here is a sample header file that I include using the "source" command in Bash that has SOME (not all) ansi mnemonics:
The text was updated successfully, but these errors were encountered: