Skip to content

Commit 4419de9

Browse files
author
Carlos Cabanero
committed
Renamed mosh2 to mosh1 for legacy version
1 parent febd796 commit 4419de9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Blink/Commands/mosh/mosh.swift

+1
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,7 @@ enum MoshError: Error, LocalizedError {
487487

488488
func die(message: String) -> Int32 {
489489
print(message, to: &stderr)
490+
print("Use mosh1 for the deprecated (previous) mosh version.", to: &stderr)
490491
return -1
491492
}
492493

Sessions/MCPSession.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ - (void)executeWithArgs:(NSString *)args {
113113
return;
114114
}
115115
}
116-
if ([@"mosh2" isEqualToString:self.sessionParams.childSessionType] && self.sessionParams.hasEncodedState) {
116+
if ([@"mosh1" isEqualToString:self.sessionParams.childSessionType] && self.sessionParams.hasEncodedState) {
117117
//BlinkMosh *mosh = [[BlinkMosh alloc] initWithMcpSession: self device:_device andParams:self.sessionParams.childSessionParams];
118118
MoshSession *mosh = [[MoshSession alloc] initWithDevice:_device andParams:self.sessionParams.childSessionParams];
119119
mosh.mcpSession = self;
@@ -214,8 +214,8 @@ - (BOOL)_runCommand:(NSString *)cmdline skipHistoryRecord: (BOOL) skipHistoryRec
214214
if (self.sessionParams.hasEncodedState) {
215215
return NO;
216216
}
217-
} else if ([cmd isEqualToString:@"mosh2"]) {
218-
[self _runMosh2WithArgs:cmdline];
217+
} else if ([cmd isEqualToString:@"mosh1"]) {
218+
[self _runMosh1WithArgs:cmdline];
219219
if (self.sessionParams.hasEncodedState) {
220220
return NO;
221221
}
@@ -306,10 +306,10 @@ - (void)_runMoshWithArgs:(NSString *)args
306306
_childSession = nil;
307307
}
308308

309-
- (void)_runMosh2WithArgs:(NSString *)args
309+
- (void)_runMosh1WithArgs:(NSString *)args
310310
{
311311
self.sessionParams.childSessionParams = [[MoshParams alloc] init];
312-
self.sessionParams.childSessionType = @"mosh2";
312+
self.sessionParams.childSessionType = @"mosh1";
313313
//BlinkMosh *mosh = [[BlinkMosh alloc] initWithMcpSession: self device:_device andParams:self.sessionParams.childSessionParams];
314314
// TODO Connect previous mosh
315315
MoshSession *mosh = [[MoshSession alloc] initWithDevice:_device andParams:self.sessionParams.childSessionParams];

Sessions/MoshSession.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
static NSDictionary *experimentalIPStrings = nil;
4949

5050
static const char *usage_format =
51-
"Usage: mosh [options] [user@]host|IP [--] [command]"
51+
"This is the Original mosh command. Use in case new mosh command does not work.\r\n"
52+
"Please let us know in that case.\r\n"
53+
"Usage: mosh1 [options] [user@]host|IP [--] [command]"
5254
"\r\n"
5355
" --server=PATH mosh server on remote machine\r\n"
5456
" (default: mosh-server)\r\n"

0 commit comments

Comments
 (0)