Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initialColumns and initialRow to PtyProcessBuilder
Wrap common process parameters into PtyProcessOptions for easier modifying process parameters in future.
- Loading branch information
Showing
5 changed files
with
143 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.pty4j; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Map; | ||
|
||
public class PtyProcessOptions { | ||
private final String[] myCommand; | ||
private final Map<String, String> myEnvironment; | ||
private final String myDirectory; | ||
private final boolean myRedirectErrorStream; | ||
private final Integer myInitialColumns; | ||
private final Integer myInitialRows; | ||
|
||
PtyProcessOptions(@NotNull String[] command, | ||
@Nullable Map<String, String> environment, | ||
@Nullable String directory, | ||
boolean redirectErrorStream, | ||
@Nullable Integer initialColumns, | ||
@Nullable Integer initialRows) { | ||
myCommand = command; | ||
myEnvironment = environment; | ||
myDirectory = directory; | ||
myRedirectErrorStream = redirectErrorStream; | ||
myInitialColumns = initialColumns; | ||
myInitialRows = initialRows; | ||
} | ||
|
||
@NotNull | ||
public String[] getCommand() { | ||
return myCommand; | ||
} | ||
|
||
@Nullable | ||
public Map<String, String> getEnvironment() { | ||
return myEnvironment; | ||
} | ||
|
||
@Nullable | ||
public String getDirectory() { | ||
return myDirectory; | ||
} | ||
|
||
public boolean isRedirectErrorStream() { | ||
return myRedirectErrorStream; | ||
} | ||
|
||
@Nullable | ||
public Integer getInitialColumns() { | ||
return myInitialColumns; | ||
} | ||
|
||
@Nullable | ||
public Integer getInitialRows() { | ||
return myInitialRows; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters