User forums > Help
TERM environment variable not set.
stuarte:
Hi,
I seem(?!) to be having a term problem with Code::Blocks not being able to use a terminal, except that it does use it. With a breakpoint set at line 133 (see attached file "main.txt") and running the debugger up to that point, the program displays the output shown below in a Program Console window.
warning: GDB: Failed to set controlling terminal: Operation not permitted
TERM environment variable not set.
Word Find
Menu
====
Choose level of difficulty:
Beginning <b/B>
Intermediate <i/I>
Advanced <a/A>
Quit <q/Q>
Choice: b
Find a word in:
ACDCKEYBOARDPSKQSKMOUSE
TERM environment variable not set.
Please note that the last line of the output shown above occurs after an in-program delay and might(?) somehow be triggered by the fgets() at line 133, even though this instruction has not been executed at this point. (??)
I have attached the debug log in the file "debug_log.txt". I have verified that :-
a) "Settings/Debugger.../General settings" has "Terminal to launch console programs:" is set to "xterm -T $TITLE -e"
b) my ~/.bashrc has a last line of "export TERM=xterm-256color".
With all the previous settings verified :-
a) is there some other C::B setting that must also be set ?
b) do I somehow have to "tell" GDB to also set a TERM environment variable, given that C::B is using GDB ?
Stuart
BlueHazzard:
Is it working? I think the warning "warning: GDB: Failed to set controlling terminal: Operation not permitted" can be ignored.
What terminal are you using? Xterm?
What is your setting in Settings->Environment->Shell to run commands in ?
stuarte:
Good morning BlueHazzard,
Thank you for a swift reply. As I stated in my previous post, C:B is using the terminal. It's just these error messages that have me confused. You say the warning can be ignored. thank you for that. I will now do so.
"Settings/Environment.../General settings" has "Shell to run commands in:" set to "/bin/sh -c" whereas the system is using bash. As this may be the "problem" (I understand that bash is a sort of superset of sh), would it be acceptable to C::B to replace /bin/sh -c with /bin/bash -c ? That is, would C::B recognise bash as a viable shell ?
Stuart
stuarte:
Hi again BlueHazzard,
Errata: It would appear that the shell in use is /usr/bin/dash. It also has a "-c" option according to "man dash". Please accept my apologies for the misinformation in my previous posting.
Stuart
stuarte:
Good afternoon,
Update:
I changed "Settings/Environment.../General settings/Shell to run commands in:" to /usr/bin/dash -c. This has made no difference. I am still getting the same warnings as before. Could it be that C::B does not recognise the dash shell ?
Stuart
Navigation
[0] Message Index
[#] Next page
Go to full version