Skip to content

Commit f8a84d2

Browse files
committed
feature: client: terminal disconnected...: write on next line
1 parent 49d6581 commit f8a84d2

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

client/gritty.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export function _onConnect(socket, fitAddon, {env, cwd, cols, rows, command, aut
128128
}
129129

130130
export function _onDisconnect(terminal) {
131+
terminal.writeln('');
131132
terminal.writeln('terminal disconnected...');
133+
terminal.writeln('');
132134
}
133135

134136
export function _onData(terminal, data) {

test/client/gritty.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,18 @@ test('gritty: onConnect: socket: terminal', (t) => {
181181
test('gritty: onDisconnect: terminal', (t) => {
182182
const writeln = stub();
183183

184-
const msg = 'terminal disconnected...';
185-
186184
_onDisconnect({
187185
writeln,
188186
});
189187

190-
t.calledWith(writeln, [msg], 'should call terminal.writeln');
188+
const {args} = writeln;
189+
const expected = [
190+
[''],
191+
['terminal disconnected...'],
192+
[''],
193+
];
194+
195+
t.deepEqual(args, expected);
191196
t.end();
192197
});
193198

0 commit comments

Comments
 (0)