Configure VS Code for Debugging on Kubuntu

Brother Bill brotherbill at mail.com
Fri Feb 20 11:43:15 UTC 2026


On Kubuntu Linux, the Terminal pane is not getting stdout 
messages.
The Debugger pane will write them out only if stdout.flush().
This works on Fedora 43 Linux.

Console messages:
```
Warning: 'set target-async', an alias for the command 'set 
mi-async', is deprecated.
Use 'set mi-async'.

Running executable

This GDB supports auto-downloading debuginfo from the following 
URLs:
   <https://debuginfod.ubuntu.com>
Enable debuginfod for this session? (y or [n]) [answered N; input 
not from terminal]
Debuginfod has been disabled.
To make this setting permanent, add 'set debuginfod enabled off' 
to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, D main () at source/app.d:9
9		writeln(top.id);     stdout.flush;
0
1
2
[Inferior 1 (process 40334) exited normally]

```

source/app.d
```
import std.stdio : writeln, stdout;

void main()
{
	auto top    = Point(7, 0);
	auto middle = Point(8, 0);
	auto bottom = Point(9, 0);

	writeln(top.id);     stdout.flush;
	writeln(middle.id);  stdout.flush;
	writeln(bottom.id);  stdout.flush;
}

struct Point
{
	size_t id; 		// Object id
	int    line;
	int    column;

	// The id to be used for the next object
	static size_t nextId;

	this(int line, int column)
	{
		this.line   = line;
		this.column = column;
		this.id     = makeNewId();
	}

	static size_t makeNewId()
	{
		immutable newId = nextId;

		++nextId;

		return newId;
	}
}
```

launch.json
```
{
     // Use IntelliSense to learn about possible attributes.
     // Hover to view descriptions of existing attributes.
     // For more information, visit: 
https://go.microsoft.com/fwlink/?linkid=830387
     "version": "0.2.0",
     "configurations": [
         {
             "type": "code-d",
             "request": "launch",
             "dubBuild": true,
             "name": "Build & Debug DUB project",
             "cwd": "${command:dubWorkingDirectory}",
             "program": "${command:dubTarget}"
         }
     ]
}
```

Any suggestions?


More information about the Digitalmars-d-learn mailing list