Rework shell detection and initialization

This should fix some issues with Powershell Core and ttys
This commit is contained in:
crschnick 2023-04-26 13:45:32 +00:00
parent 7c095cea4c
commit c511a72187
2 changed files with 5 additions and 1 deletions

View file

@ -42,7 +42,7 @@ public class ScriptHelper {
ShellControl processControl, List<String> init, String toExecuteInShell, boolean login) {
ShellDialect t = processControl.getShellDialect();
String nl = t.getNewLine().getNewLineString();
var content = String.join(nl, init) + nl;
var content = String.join(nl, init.stream().filter(s -> s != null).toList()) + nl;
if (login) {
var applyProfilesCommand = t.applyProfileFilesCommand();

View file

@ -19,6 +19,10 @@ public interface ShellDialect {
String fileArgument(String s);
void prepareDumbTerminalCommands(ShellControl sc) throws Exception;
String prepareProperTerminalCommands();
default String applyRcFileCommand() {
return null;
}