Welcome to the Linux Foundation Forum!

difference in GUI & CLI in command execution


some commands give different output in graphical terminal and command line, why they do so?

e.g. $ echo -e "\033[5m"

will set blinking text in CLI mode but it wont work in Xterm........ why???

there are many commands with this problem.


  • poundjd
    poundjd Posts: 3
    Actually it is not a "problem". the CLI was and for many remains the primary interface to the system. Almost all commands were writen to work with the CLI. there are lots of special cases like that that enhance the CLI. These special cases are not input to the command but are processes by the shell or CLI. Xterm does not process these shell commands. that is why the same string will produce different effects in a CLI and Xtem command windows.
  • gr8linux
    gr8linux Posts: 26
    and what abt when a command gives output on xterm but not on CLI

    e.g. echo -e "\033[1m"

    will bold the text on xterm but wont affect the CLI.................

    shell are the same on both xterm & CLI......... then why it happens?
    is it a case of some capabilities of shell or something else...........
  • woboyle
    woboyle Posts: 501
    The effect of escape sequences (special strings of characters that control terminal operation) varies from terminal to terminal. The basic xterm is I believe a VT-120 terminal emulator, so the VT-100/120 terminal sequences apply. The console command line may be different, as might be the KDE or Gnome console windows CLI.

    Back in the days before GUI's were common, there were dozens of different terminal manufacturers, and most had their own sets of commands, which is what terminal emulators sprang from, so that a generic program could emulate any of these terminals, such as HP, IBM, DEC, Qume, Tektronix, etc. In my deep, dark past I wrote a terminal emulator program that could use the termcap file for any terminal to drive its internal state machine and convert that into the actual terminal you were running on. It was a pretty slick bit of work, if I have to say so for myself. I used it as a component in an implementation of the Telnet client I wrote so that it could run full-screen applications on any system, even those that had no termcap database, simply by emulating the standard terminal for that system. HP systems were popular.


Upcoming Training