add interactive mode detection