diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-06 07:21:30 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-01-06 07:21:30 +0200 |
commit | d9b4dd25357d6c6d016d2ac7456df560c086ba84 (patch) | |
tree | 1f4ee1b2506f252831a3673349b060c5d3dd5853 /src | |
parent | f45839c10ddf30e735354f66f1f4b3886e181437 (diff) |
App: Tell user about IPC command destination
Diffstat (limited to 'src')
-rw-r--r-- | src/app.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -713,18 +713,22 @@ static void communicateWithRunningInstance_App_(iApp *d, iProcessId instance, | |||
713 | appendCStr_String(cmds, "tabs.new\n"); | 713 | appendCStr_String(cmds, "tabs.new\n"); |
714 | requestRaise = iTrue; | 714 | requestRaise = iTrue; |
715 | } | 715 | } |
716 | iBool gotResult = iFalse; | ||
716 | if (!isEmpty_String(cmds)) { | 717 | if (!isEmpty_String(cmds)) { |
717 | iString *result = communicate_Ipc(cmds, requestRaise); | 718 | iString *result = communicate_Ipc(cmds, requestRaise); |
718 | if (result) { | 719 | if (result) { |
719 | fwrite(cstr_String(result), 1, size_String(result), stdout); | 720 | fwrite(cstr_String(result), 1, size_String(result), stdout); |
720 | fflush(stdout); | 721 | fflush(stdout); |
722 | if (!isEmpty_String(result)) { | ||
723 | gotResult = iTrue; | ||
724 | } | ||
721 | } | 725 | } |
722 | delete_String(result); | 726 | delete_String(result); |
723 | } | 727 | } |
724 | iUnused(instance); | 728 | iUnused(instance); |
725 | // else { | 729 | if (!gotResult) { |
726 | // printf("Lagrange already running (PID %d)\n", instance); | 730 | printf("Commands sent to Lagrange process %d\n", instance); |
727 | // } | 731 | } |
728 | terminate_App_(0); | 732 | terminate_App_(0); |
729 | } | 733 | } |
730 | #endif /* defined (LAGRANGE_ENABLE_IPC) */ | 734 | #endif /* defined (LAGRANGE_ENABLE_IPC) */ |