User forums > Help

TERM environment variable not set.

<< < (2/2)

BlueHazzard:
I am not quite sure where this warnings are coming from, but certainly not from within codeblocks.

Also i was wrong, what i actually wanted to know is in Settings->Environment->General Settings->Terminal to launch console programs...
I would try to install xterm and select xterm in this setting and look if it gets better

AndrewCot:
I am in agreement with BlueHazzard in the I have not seen warning coming from programs that get called from C::B being on the shell being used as all Linux and MAc shells are not created equal and work differently.

I also spotted in the last week or so that the code in different spots uses/accesses the shell in some strange ways (strange as in I do not understand why the code works one way in soma areas of the code and differently in other areas). I have not had any issues with the shell so I have not investigated it as I am working on other things.


An example of this is in compilergcc.cpp, where the first code snippet uses the config console_shell value, but the second snippet uses the environment SHELL..... I have no idea why or what ramifications this has, if any.

--- Code: ---        if (!platform::windows)
        {
            const wxString shell(Manager::Get()->GetConfigManager("app")->Read("/console_shell", DEFAULT_CONSOLE_SHELL));
            cmd->command = shell + " '" + cmd->command + "'";
        }

--- End code ---

--- Code: ---

        if (!platform::windows)
        {
            // for non-win platforms, use m_ConsoleTerm to run the console app
            wxString term = Manager::Get()->GetConfigManager(_T("app"))->Read(_T("/console_terminal"), DEFAULT_CONSOLE_TERM);
            term.Replace(_T("$TITLE"), titleStr);
            term.Replace(_T("$WORKDIR"), dirStr);
            cmd << term << strSPACE;

            wxString shell;
            wxGetEnv(_T("SHELL"), &shell);
            if (shell.Contains(_T("csh")))
            {
                // "The csh is a tool utterly inadequate for programming,
                //  and its use for such purposes should be strictly banned!"
                //                 -- Csh Programming Considered Harmful
                command << DEFAULT_CONSOLE_SHELL << strSPACE;
                // each shell execution must be enclosed to "":
                // xterm -T X -e /bin/sh -c "/usr/bin/cb_console_runner X"
                // here is first \"
                command << strQUOTE;
                commandIsQuoted = true;
            }
        }


--- End code ---

stuarte:
Good afternoon,

@BlueHazzard: I just checked with Synaptic and xterm version 353-1ubuntu1-20.04.2 (the latest version from the repo) is already installed. "Settings->Environment->General Settings->Terminal to launch console programs..." is set to "xterm -T $TITLE -e".

@AndrewCot: "I have not had any issues with the shell so I have not investigated it as I am working on other things." Understood. Please do not look upon my postings as some way to (somehow???) exert some kind of pressure. They are genuine requests for help. I am also mindful of a book called "The Deming Dimension" which explained, amongst many things, the need for feedback. It in both those veins that my postings are made.

Stuart

Navigation

[0] Message Index

[*] Previous page

Go to full version