void (DnDEvent event) { TransferableWrapper tw = ObjectUtils.tryCast(event.getAttachedObject(), TransferableWrapper.class); if (tw != null) { PsiDirectory dir = getDirectory(ArrayUtil.getFirstElement(tw.getPsiElements())); if (dir != null && tw.getPsiElements().length == 1) { TerminalToolWindowManager view = TerminalToolWindowManager.getInstance(dir.getProject()); TerminalTabState state = new TerminalTabState(); state.myWorkingDirectory = dir.getVirtualFile().getPath(); view.createNewSession(view.getTerminalRunner(), state); } } }