$attach in regular interactive is actually more complex than it seems. It's really meant for debugging scripts that you want to start executing from interactive. For example, you can set a breakpoint in a function that you're working on, call into it from the
interactive, and debug it with whatever parameters you were using. It isn't really a good feature for extended debugging sessions - it's quite an old feature, well before we understood how people would actually want to use it :)