Skip to content

Commit 0c3ad8e

Browse files
segreyintellij-monorepo-bot
authored andcommitted
[terminal] IJPL-219717 rename getStartDirectory to getDefaultStartWorkingDirectory; improve its documentation
GitOrigin-RevId: ae194b5e80305ea6c450f65a07daae1bbab6e36a
1 parent 1048416 commit 0c3ad8e

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

plugins/terminal/src/org/jetbrains/plugins/terminal/LocalTerminalCustomizer.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,23 @@
1010
import org.jetbrains.annotations.NotNull;
1111
import org.jetbrains.annotations.Nullable;
1212
import org.jetbrains.plugins.terminal.runner.TerminalCustomizerLocalPathTranslator;
13+
import org.jetbrains.plugins.terminal.startup.MutableShellExecOptions;
14+
import org.jetbrains.plugins.terminal.startup.ShellExecOptionsCustomizer;
1315

1416
import java.util.Arrays;
1517
import java.util.List;
1618
import java.util.Map;
1719

1820
/**
19-
* @deprecated use {@link org.jetbrains.plugins.terminal.startup.ShellExecOptionsCustomizer} instead
21+
* @deprecated use {@link ShellExecOptionsCustomizer} instead
2022
*/
2123
@Deprecated
2224
public abstract class LocalTerminalCustomizer {
2325
public static final ExtensionPointName<LocalTerminalCustomizer> EP_NAME =
2426
ExtensionPointName.create("org.jetbrains.plugins.terminal.localTerminalCustomizer");
2527

2628
/**
29+
* @deprecated use {@link ShellExecOptionsCustomizer#customizeExecOptions(Project, MutableShellExecOptions)} instead
2730
* May alter the command to be run in terminal and/or adjust starting environment. <p/>
2831
* Please note that environment variables are local to the remote {@code eelDescriptor}.
2932
* For example, it should contain {@code /path/to/dir} instead of
@@ -56,6 +59,7 @@ public abstract class LocalTerminalCustomizer {
5659
* See the {@code bash-integration.bash} script
5760
* for more information on how to alter the execution process.
5861
*/
62+
@Deprecated
5963
public @NotNull List<String> customizeCommandAndEnvironment(
6064
@NotNull Project project,
6165
@Nullable String workingDirectory,
@@ -108,8 +112,10 @@ public String[] customizeCommandAndEnvironment(@NotNull Project project,
108112
}
109113

110114
/**
115+
* @deprecated use {@link ShellExecOptionsCustomizer#getDefaultStartWorkingDirectory(Project)} instead
111116
* @return path to the directory to run the terminal in or null if default directory should be used
112117
*/
118+
@Deprecated
113119
protected @Nullable String getDefaultFolder(@NotNull Project project) {
114120
return null;
115121
}

plugins/terminal/src/org/jetbrains/plugins/terminal/TerminalProjectOptionsProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class TerminalProjectOptionsProvider(val project: Project) : PersistentStateComp
7777
get() {
7878
for (customizer in ShellExecOptionsCustomizer.EP_NAME.extensionList) {
7979
try {
80-
val dir = customizer.getStartDirectory(project)
80+
val dir = customizer.getDefaultStartWorkingDirectory(project)
8181
if (dir != null) {
8282
return dir.toString()
8383
}

plugins/terminal/src/org/jetbrains/plugins/terminal/startup/ShellExecOptionsCustomizer.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ interface ShellExecOptionsCustomizer {
2727
fun customizeExecOptions(project: Project, shellExecOptions: MutableShellExecOptions) {}
2828

2929
/**
30-
* Retrieves the starting directory for the given project.
30+
* Customizes the default start working directory for the given project.
31+
* It serves as a default value for the "Start directory" field in "Settings | Tools | Terminal".
32+
* The value of this field determines the working directory for new shell sessions.
3133
*
3234
* The method can be called on any thread without a read action.
3335
*
34-
* @return the starting directory, or `null` if no directory is specified
35-
* In case of `null`, the default start directory will be used.
36+
* @return the starting directory, or `null` to use the default start working directory
3637
*/
37-
fun getStartDirectory(project: Project): Path? = null
38+
fun getDefaultStartWorkingDirectory(project: Project): Path? = null
3839

3940
companion object {
4041
@ApiStatus.Internal

0 commit comments

Comments
 (0)