feat: 连接终端.
This commit is contained in:
@@ -66,7 +66,7 @@ public class TerminalManager {
|
||||
public void closeAll(String channelId) {
|
||||
// 获取并移除
|
||||
ConcurrentHashMap<String, ITerminalSession> session = channelSessions.remove(channelId);
|
||||
if (Maps.isEmpty(session)) {
|
||||
if (!Maps.isEmpty(session)) {
|
||||
session.values().forEach(Streams::close);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,14 @@ public class TerminalSession implements ITerminalSession {
|
||||
if (!executor.isConnected()) {
|
||||
executor.connect();
|
||||
}
|
||||
config.setCols(cols);
|
||||
config.setRows(rows);
|
||||
executor.size(cols, rows);
|
||||
executor.resize();
|
||||
// 大小发生变化 则修改大小
|
||||
if (cols != config.getCols() ||
|
||||
rows != config.getRows()) {
|
||||
config.setCols(cols);
|
||||
config.setRows(rows);
|
||||
executor.size(cols, rows);
|
||||
executor.resize();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user