If the prompt contains characters early that the filesystem will not accept in a filename (for example "https://..."), Termite will fail when saving the Python script, since the start of the prompt is used for the filename. The filename should be sanitized before trying to save the script.