Skip to content

Commit

Permalink
Fix for method 1 and 2.
Browse files Browse the repository at this point in the history
Send ^C as the first character of output when entering tmux integration mode.
  • Loading branch information
gnachman committed Aug 8, 2023
1 parent b2268b0 commit ae81925
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions sources/PTYSession.m
Expand Up @@ -7890,6 +7890,7 @@ - (void)tmuxInitialCommandDidCompleteSuccessfully {
// opened. Initial window opening is always blocked on establishing the server version.
- (void)kickOffTmux {
_haveKickedOffTmux = YES;
[_tmuxController sendControlC];
[_tmuxController ping];
[_tmuxController validateOptions];
[_tmuxController checkForUTF8];
Expand Down
1 change: 1 addition & 0 deletions sources/TmuxController.h
Expand Up @@ -131,6 +131,7 @@ extern NSString *const kTmuxControllerDidChangeHiddenWindows;
- (void)fitLayoutToWindows;
- (void)validateOptions;
- (void)ping;
- (void)sendControlC;
- (void)enablePauseModeIfPossible;
- (void)unpausePanes:(NSArray<NSNumber *> *)wps;
- (void)pausePanes:(NSArray<NSNumber *> *)wps;
Expand Down
8 changes: 8 additions & 0 deletions sources/TmuxController.m
Expand Up @@ -1081,6 +1081,14 @@ - (void)setClientSize:(NSSize)size {
[gateway_ sendCommandList:commands];
}

- (void)sendControlC {
[gateway_ sendCommand:[NSString stringWithFormat:@"%cphony-command", 3]
responseTarget:nil
responseSelector:nil
responseObject:nil
flags:kTmuxGatewayCommandShouldTolerateErrors];
}

- (void)ping {
// This command requires tmux 3.2, but if it fails that's OK too.
[gateway_ sendCommand:@"refresh-client -fpause-after=0,wait-exit"
Expand Down

0 comments on commit ae81925

Please sign in to comment.