/*
 * Copyright (c) Joachim Ansorg, mail@ansorg-it.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ansorgit.plugins.bash.runner;

import com.ansorgit.plugins.bash.util.BashIcons;
import com.ansorgit.plugins.bash.util.BashInterpreterDetection;
import com.intellij.execution.BeforeRunTask;
import com.intellij.execution.RunManagerEx;
import com.intellij.execution.configuration.ConfigurationFactoryEx;
import com.intellij.execution.configurations.ConfigurationTypeBase;
import com.intellij.execution.configurations.ConfigurationTypeUtil;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.execution.configurations.RunConfigurationModule;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

import java.util.Collections;

/**
 * Bash run configuration type.
 *
 * @author jansorg
 */
public class BashConfigurationType extends ConfigurationTypeBase {
    public BashConfigurationType() {
        super("BashConfigurationType", "Bash", "Bash run configuration", BashIcons.BASH_FILE_ICON);

        addFactory(new BashConfigurationFactory(this));
    }

    @NotNull
    public static BashConfigurationType getInstance() {
        return ConfigurationTypeUtil.findConfigurationType(BashConfigurationType.class);
    }

    private static class BashConfigurationFactory extends ConfigurationFactoryEx {
        BashConfigurationFactory(BashConfigurationType configurationType) {
            super(configurationType);
        }

        @Override
        public void onNewConfigurationCreated(@NotNull RunConfiguration configuration) {
            //the last param has to be false because we do not want a fallback to the template (we're creating it right now) (avoiding a SOE)
            RunManagerEx.getInstanceEx(configuration.getProject()).setBeforeRunTasks(configuration, Collections.<BeforeRunTask>emptyList(), false);
        }

        @NotNull
        @Override
        public RunConfiguration createTemplateConfiguration(@NotNull Project project) {
            BashRunConfiguration configuration = new BashRunConfiguration(new RunConfigurationModule(project), this, "");
            configuration.setInterpreterPath(BashInterpreterDetection.instance().findBestLocation());

            return configuration;
        }
    }
}

@@ -1185,16 +1185,71 @@
 Module;%0A
+import com.intellij.openapi.project.PossiblyDumbAware;%0A
 import c
@@ -1285,16 +1285,16 @@
 roject;%0A
-
 import o
@@ -1486,16 +1486,45 @@
 ypeBase 
+implements PossiblyDumbAware 
 %7B%0A    pu
@@ -1783,24 +1783,24 @@
 nstance() %7B%0A
-
         retu
@@ -1879,24 +1879,101 @@
 ss);%0A    %7D%0A%0A
+    @Override%0A    public boolean isDumbAware() %7B%0A        return true;%0A    %7D%0A%0A
     private 

Make Bash run configurations dumb mode aware (used w/ 182.x and possibly earlier)