I frequently find myself accidentally running python files as shell scripts, e.g.
This has potential to cause lots of damage if there was no shebang line at the start of the file, so I would like a way for zsh to give a warning for doing this.
Does this functionality already exist somewhere?
If not, I'm thinking of using
accept-line to implement this, but this seems like a catch-all solution, is there a more specific way?