session: add support to auto detect input format (for init file)