function on_enter(path) print(path) end add_event('enter-dir',on_enter) function commands.remove() remove_event('enter-dir',on_enter) end