Tuesday, February 22, 2022

[SOLVED] How to know terminal's exact name in Linux?

Issue

I've met problems when I edit MakeFile, and the original code is as below:

 TERMINAL :=terminator
 debug: 
 $(UCOREIMG)
 $(V)$(QEMU) -S -s -parallel stdio -hda $< -serial null &
 $(V)sleep 2
 $(V)$(TERMINAL)  -e "cgdb -q -x ./tools/gdbinit"

And when I use the command"make debug", I was given:

/bin/sh: 1: terminator: not found
Makefile:221: recipe for target 'debug' failed
make: *** [debug] Error 127

Solution

You can do several things:

  • Install terminator on your system. This can be the best option, as your Makefile requests for it.

  • Use another terminal emulator like xterm or gnome-terminal for that. cgdb will run on them without any problem also, and you'll have a fast way to solve the problem without having to dig where terminator comes from. For this, just substitute terminator with gnome-terminal or xterm in the Makefile.

  • If you run on a linux console, without the possibility of launching a virtual terminal application, then you have to do more work and switch to another console an execute there the command by hand. For that:

    # switch to tty02, for example.
    cd "the/directory/where/the/terminator/program/was/tried"
    cgdb -q -x ./tools/gdbinit
    


Answered By - Luis Colorado
Answer Checked By - David Marino (WPSolving Volunteer)