Why are you using a 'character grid' instead of an std::list<std::string>? You could check each string and split it when you encounter a newline, pushing back multiple substrings to the list, and popping the front of the list when you get beyond your desired buffer size (say, 100 lines or more).
Which function is crashing? Under what conditions does it crash?
Are you saying the program crashes before you even enter int main()? If so, it's probably because your "char charactergrid[1000][1000];" takes up almost a full megabyte on the stack. You shouldn't put that kind of memory on the stack, it's not made for that. Using a std::vector (not 2D!) or std::list of std::strings is a far superior and 'correct' solution.
After a bit of testing, I found It is the character show function.
Also, I can't just make the strings into smaller strings, as they are going to be edited, which may or may not include adding or removing newline characters that would move all the other rows around.
Also, apparently the loop doesn't immedently crash the program, rather, at some point something goes wrong a few seconds in randomly, and suddenly every single iteration of the loop takes over a second, so I was able to add a crash prevention of sorts, that will automatically shut down the whole program if a single iteration of the scripting loop takes over 200ms.