devel/pop-screen will also dismiss any screen that's open (note that if you run this when just one screen is open, it will quit DF). But that will work even if the screen doesn't implement a safety feature itself (no need for "die").
Edit:
See, the thing is: "text" is stored not as a string, but as value pair with text.value being the actual string. (I guess calling tostring() on it also works).
It's actually a pointer, and .value is equivalent to dereferencing the pointer in C++.
Note that tostring() will NOT work as you expect - it will produce something like "<string: 0x1286737>", which is a string representation of the
pointer, not the actual value. tostring() doesn't do anything special for different types of pointers (e.g. pointers to strings).
Because I only encountered it in the custom changed compile of dfhack I did - it didn't throw the error, for the same unit, in normal 43.03 compile *shrug*.
Usually non-pointers don't change to pointers. But 0.43.03 is ancient enough that maybe something else changed.
Edit 2: late here, but
i love the idea of this, but when i put the relations indicator and indicator screen luas into the right places, i came across a problem - the onmapload_extra.init doesn't exist, so i popped the keybinds into the dfhack.init which seemed to work.
In general, you could just create the file.
Fleeting Frames: keybinding commands affect the whole DF session, so they don't require a map to be loaded. Sure, the commands being run may require a map, but "keybinding" itself doesn't care at all. You even provided contexts for all of them, which prevents them from running before a map is loaded, which is good. But telling people to add them to dfhack.init would be better - that's where all of the default keybindings are.
(Oh, and the "_extra" suffix isn't necessary either - anything matching "onMapLoad*.init" or "onLoadMap*.init" will work.)