diff --git a/plugins/terminal/src/org/jetbrains/plugins/terminal/TerminalShellCommandHandlerHelper.java b/plugins/terminal/src/org/jetbrains/plugins/terminal/TerminalShellCommandHandlerHelper.java index 97ca9994d481..5a2549b2e93c 100644 --- a/plugins/terminal/src/org/jetbrains/plugins/terminal/TerminalShellCommandHandlerHelper.java +++ b/plugins/terminal/src/org/jetbrains/plugins/terminal/TerminalShellCommandHandlerHelper.java @@ -42,6 +42,10 @@ public class TerminalShellCommandHandlerHelper { private volatile Boolean myHasRunningCommands; private PropertiesComponent myPropertiesComponent; + private final SingletonNotificationManager myNotificationManager = + new SingletonNotificationManager(NotificationGroup.toolWindowGroup("Terminal", TerminalToolWindowFactory.TOOL_WINDOW_ID), + NotificationType.INFORMATION, null); + TerminalShellCommandHandlerHelper(@NotNull ShellTerminalWidget widget) { myWidget = widget; myAlarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, widget); @@ -88,17 +92,15 @@ public class TerminalShellCommandHandlerHelper { if (result != null) { String title = TerminalBundle.message("smart_command_execution.notification.title"); String content = TerminalBundle.message("smart_command_execution.notification.text", GOT_IT); - new SingletonNotificationManager( - NotificationGroup.toolWindowGroup("Terminal", TerminalToolWindowFactory.TOOL_WINDOW_ID), NotificationType.INFORMATION, null) - .notify(title, content, project, - new NotificationListener.Adapter() { - @Override - protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { - if (GOT_IT.equals(e.getDescription())) { - getPropertiesComponent().setValue(TERMINAL_CUSTOM_COMMANDS_GOT_IT, true, false); - } - } - }); + myNotificationManager.notify(title, content, project, + new NotificationListener.Adapter() { + @Override + protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { + if (GOT_IT.equals(e.getDescription())) { + getPropertiesComponent().setValue(TERMINAL_CUSTOM_COMMANDS_GOT_IT, true, false); + } + } + }); } }