User forums > Help
Font size of Xterm output when running console application?
cacb:
When you run a console application from the Code::Blocks IDE, you get an Xterm under Ubuntu 20.04. By default, the font size in this terminal window is extremely small. Is there a way to control that from a C::B setting? If not, is there some other way?
Edit: To see actual size of attachment font, it looks like the file must be downloaded
Name : Code::Blocks
Version : svn-r12487
SDK Version : 2.11.0
Scintilla Version : 3.7.5
Author : The Code::Blocks Team
E-mail : info@codeblocks.org
Website : http://www.codeblocks.org
OS : Linux 5.8.0-63-generic x86_64
Desktop environment : KDE
Scaling factor : 1.000000
Detected scaling factor: 1.104167
Display PPI : 108x106
Display count : 1
Display 0 : XY=[0,0]; Size=[2560,1440]; Primary
wxWidgets Library (wxGTK port)
Version 3.0.4 (Unicode: wchar_t, debug level: 0),
compiled at May 31 2021 10:26:03
Runtime version of toolkit used is 2.24.
Compile-time GTK+ version is 2.24.32.
oBFusCATed:
https://askubuntu.com/questions/161652/how-to-change-the-default-font-size-of-xterm
or switch to use the gnome-terminal.
cacb:
Thanks for the quick and helpful reply...
It turns out it was much easier than I thought. Since I use KDE, there is an option to simply use konsole, the standard KDE terminal from Code::Blocks. Then I get my default font settings for that. All is good, thanks again.
oBFusCATed:
We have to do something more clever about this, but I'm not totally sure what and I don't have much time to experiment at the moment.
Probably some kind of auto-detect dialog would be a good idea or a detection scheme which tries to run them one by one using some hard-coded priority.
Also, there are these two, but I cannot spend time on them at the moment, but are important:
https://sourceforge.net/p/codeblocks/tickets/1004/
https://sourceforge.net/p/codeblocks/tickets/1005/
Can you try the patch from 1005 and tell me if it works for you? It would be helpful give that you don't use the ubuntu defaults of gnome+gnome-terminal.
cacb:
Not sure how to apply a patch and it would take me time to figure out, and I don't have the time now.
BUT: why not leave the problem to the operating system and/or desktop environment? Maybe, instead of C::B calling a specific xterm, konsole, gnome-terminal or whatever, would it perhaps be a smarter solution if C::B called on x-terminal-emulator instead, and let the OS start the correct terminal emulator pre-configured by the desktop, or even reconfigured by the user?
--- Code: ---which x-terminal-emulator
/usr/bin/x-terminal-emulator
--- End code ---
If I start x-terminal-emulator from the KDE menu search field, I get an instance of konsole because on my system x-terminal-emulator maps to konsole:
--- Code: ---sudo update-alternatives --config x-terminal-emulator
There are 5 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/konsole 40 auto mode
1 /usr/bin/koi8rxterm 20 manual mode
2 /usr/bin/konsole 40 manual mode
3 /usr/bin/lxterm 30 manual mode
4 /usr/bin/uxterm 20 manual mode
5 /usr/bin/xterm 20 manual mode
Press <enter> to keep the current choice[*], or type selection number:
--- End code ---
So I am guessing that under Gnome, x-terminal-emulator maps to gnome-terminal? If that is so, would it not be a much simpler and generic solution under linux if C::B used x-terminal-emulator for console output? If correct, C::B terminal output would seamlessly adapt to the current environment.
Navigation
[0] Message Index
[#] Next page
Go to full version