|
@@ -33,6 +33,8 @@ static bool_t stdin_cb(faux_eloop_t *eloop, faux_eloop_type_e type,
|
|
|
static bool_t ktp_sync_auth(ktp_session_t *ktp, int *retcode,
|
|
|
faux_error_t *error);
|
|
|
static void reset_hotkey_table(ctx_t *ctx);
|
|
|
+static bool_t interactive_stdout_cb(ktp_session_t *ktp, const char *line, size_t len,
|
|
|
+ void *user_data);
|
|
|
|
|
|
|
|
|
static bool_t tinyrl_key_enter(tinyrl_t *tinyrl, unsigned char key);
|
|
@@ -74,6 +76,9 @@ int klish_interactive_shell(ktp_session_t *ktp, struct options *opts)
|
|
|
ctx.opts = opts;
|
|
|
faux_bzero(ctx.hotkeys, sizeof(ctx.hotkeys));
|
|
|
|
|
|
+
|
|
|
+ ktp_session_set_cb(ktp, KTP_SESSION_CB_STDOUT, interactive_stdout_cb, &ctx);
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -560,3 +565,17 @@ static bool_t ktp_sync_auth(ktp_session_t *ktp, int *retcode,
|
|
|
|
|
|
return ktp_session_retcode(ktp, retcode);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+static bool_t interactive_stdout_cb(ktp_session_t *ktp, const char *line, size_t len,
|
|
|
+ void *udata)
|
|
|
+{
|
|
|
+ ctx_t *ctx = (ctx_t *)udata;
|
|
|
+
|
|
|
+ if (write(STDOUT_FILENO, line, len) < 0)
|
|
|
+ return BOOL_FALSE;
|
|
|
+
|
|
|
+ ktp = ktp;
|
|
|
+
|
|
|
+ return BOOL_TRUE;
|
|
|
+}
|