I've tried to fold/unfold (ALT+F) script line in editor (PopOS,20.10, Ubuntu 20.04), but instead folding line, editor simply places 'f'-charaster. Do you confirm that on your linux? weird that if you follow (edit -> fold) in editor, it works.
Same results here. Pop!_OS 20.04.
Another possibly related issue I have is that on my full-sized keyboard, the Del key on the Numeric Keypad doesn't do anything in the Godot Editor, but the Del key above the Cursor Control keys works. I'd prefer that were reversed.
Your desktop environment might be abducting those alt key presses so godot just sees you pressing f.
Looks like issues is well known, there a lot of topics where LibreOffice and Blender have troubles with Alt-key. also here is issue on tracker -> https://github.com/godotengine/godot/issues/41942
On KDE i have to change the alt key usage into meta key. Then blender works with alt key. Before configuring KDE the alt key is taken by KDE.