Author Topic: Font size of Xterm output when running console application?  (Read 5642 times)

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
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.
« Last Edit: July 29, 2021, 06:42:41 pm by cacb »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size of Xterm output when running console application?
« Reply #2 on: July 29, 2021, 07:02:08 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size of Xterm output when running console application?
« Reply #3 on: July 29, 2021, 07:44:29 pm »
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: Font size of Xterm output when running console application?
« Reply #4 on: July 29, 2021, 10:34:27 pm »
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

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:

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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Font size of Xterm output when running console application?
« Reply #5 on: July 30, 2021, 01:35:20 am »
BUT: why not leave the problem to the operating system and/or desktop environment?
1. This is what the patch in 1005 does
2. This is debian/ubuntu specific. I don't have x-terminal-emulator on my gentoo. I don't think this is available on redhat based distros as well.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]