Skip to content

Commit

Permalink
Renamed mosh2 to mosh1 for legacy version
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Cabanero committed Feb 5, 2024
1 parent febd796 commit 4419de9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions Blink/Commands/mosh/mosh.swift
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ enum MoshError: Error, LocalizedError {

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

Expand Down
10 changes: 5 additions & 5 deletions Sessions/MCPSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ - (void)executeWithArgs:(NSString *)args {
return;
}
}
if ([@"mosh2" isEqualToString:self.sessionParams.childSessionType] && self.sessionParams.hasEncodedState) {
if ([@"mosh1" isEqualToString:self.sessionParams.childSessionType] && self.sessionParams.hasEncodedState) {
//BlinkMosh *mosh = [[BlinkMosh alloc] initWithMcpSession: self device:_device andParams:self.sessionParams.childSessionParams];
MoshSession *mosh = [[MoshSession alloc] initWithDevice:_device andParams:self.sessionParams.childSessionParams];
mosh.mcpSession = self;
Expand Down Expand Up @@ -214,8 +214,8 @@ - (BOOL)_runCommand:(NSString *)cmdline skipHistoryRecord: (BOOL) skipHistoryRec
if (self.sessionParams.hasEncodedState) {
return NO;
}
} else if ([cmd isEqualToString:@"mosh2"]) {
[self _runMosh2WithArgs:cmdline];
} else if ([cmd isEqualToString:@"mosh1"]) {
[self _runMosh1WithArgs:cmdline];
if (self.sessionParams.hasEncodedState) {
return NO;
}
Expand Down Expand Up @@ -306,10 +306,10 @@ - (void)_runMoshWithArgs:(NSString *)args
_childSession = nil;
}

- (void)_runMosh2WithArgs:(NSString *)args
- (void)_runMosh1WithArgs:(NSString *)args
{
self.sessionParams.childSessionParams = [[MoshParams alloc] init];
self.sessionParams.childSessionType = @"mosh2";
self.sessionParams.childSessionType = @"mosh1";
//BlinkMosh *mosh = [[BlinkMosh alloc] initWithMcpSession: self device:_device andParams:self.sessionParams.childSessionParams];
// TODO Connect previous mosh
MoshSession *mosh = [[MoshSession alloc] initWithDevice:_device andParams:self.sessionParams.childSessionParams];
Expand Down
4 changes: 3 additions & 1 deletion Sessions/MoshSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
static NSDictionary *experimentalIPStrings = nil;

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

0 comments on commit 4419de9

Please sign in to comment.