Problem with uploading sketch to mega2560

Hello! I am trying to get serial monitor of some sort to work with my board, but I am having some issues.
Output from about:
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:30:08.229Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.2.0-0.bpo.2-amd64

Using Debian Stable.

And I am trying to get output and input to work with my board. I’ve just taken some simple sample code like this:

#include <Arduino.h>

void setup() {

void loop() {
  while(Serial.available()) {
    char incoming =;

and my .ini file contains this:

platform = atmelavr
board = megaatmega2560
framework = arduino
monitor_port = /dev/ttyACM0
monitor_speed = 9600

What happens is that it builds and uploads seemingly without problems, but when I connect with CoolTerm(or the built-in serial monitor), there’s no output after I’ve sent a character to the board. The same code in the Arduino IDE builds and works as it should and CoolTerm behaves as it should. I’ve downloaded the udev-file and I’m added to dialout and plugdev groups. I’ve also tried just outputting text in the loop() function, but that also gives no result at all.

Any advice would be greatly appreciated.