|
@@ -88,12 +88,33 @@ int klish_interactive_shell(ktp_session_t *ktp, struct options *opts)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+static bool_t process_prompt_param(tinyrl_t *tinyrl, const faux_msg_t *msg)
|
|
|
|
+{
|
|
|
|
+ char *prompt = NULL;
|
|
|
|
+
|
|
|
|
+ if (!tinyrl)
|
|
|
|
+ return BOOL_FALSE;
|
|
|
|
+ if (!msg)
|
|
|
|
+ return BOOL_FALSE;
|
|
|
|
+
|
|
|
|
+ prompt = faux_msg_get_str_param_by_type(msg, KTP_PARAM_PROMPT);
|
|
|
|
+ if (prompt) {
|
|
|
|
+ tinyrl_set_prompt(tinyrl, prompt);
|
|
|
|
+ faux_str_free(prompt);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return BOOL_TRUE;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
bool_t cmd_ack_cb(ktp_session_t *ktp, const faux_msg_t *msg, void *udata)
|
|
bool_t cmd_ack_cb(ktp_session_t *ktp, const faux_msg_t *msg, void *udata)
|
|
{
|
|
{
|
|
ctx_t *ctx = (ctx_t *)udata;
|
|
ctx_t *ctx = (ctx_t *)udata;
|
|
int rc = -1;
|
|
int rc = -1;
|
|
faux_error_t *error = NULL;
|
|
faux_error_t *error = NULL;
|
|
|
|
|
|
|
|
+ process_prompt_param(ctx->tinyrl, msg);
|
|
|
|
+
|
|
if (!ktp_session_retcode(ktp, &rc))
|
|
if (!ktp_session_retcode(ktp, &rc))
|
|
rc = -1;
|
|
rc = -1;
|
|
error = ktp_session_error(ktp);
|
|
error = ktp_session_error(ktp);
|
|
@@ -230,6 +251,8 @@ bool_t completion_ack_cb(ktp_session_t *ktp, const faux_msg_t *msg, void *udata)
|
|
|
|
|
|
tinyrl_set_busy(ctx->tinyrl, BOOL_FALSE);
|
|
tinyrl_set_busy(ctx->tinyrl, BOOL_FALSE);
|
|
|
|
|
|
|
|
+ process_prompt_param(ctx->tinyrl, msg);
|
|
|
|
+
|
|
prefix = faux_msg_get_str_param_by_type(msg, KTP_PARAM_PREFIX);
|
|
prefix = faux_msg_get_str_param_by_type(msg, KTP_PARAM_PREFIX);
|
|
|
|
|
|
completions = faux_list_new(FAUX_LIST_UNSORTED, FAUX_LIST_NONUNIQUE,
|
|
completions = faux_list_new(FAUX_LIST_UNSORTED, FAUX_LIST_NONUNIQUE,
|
|
@@ -330,6 +353,8 @@ bool_t help_ack_cb(ktp_session_t *ktp, const faux_msg_t *msg, void *udata)
|
|
|
|
|
|
tinyrl_set_busy(ctx->tinyrl, BOOL_FALSE);
|
|
tinyrl_set_busy(ctx->tinyrl, BOOL_FALSE);
|
|
|
|
|
|
|
|
+ process_prompt_param(ctx->tinyrl, msg);
|
|
|
|
+
|
|
help_list = faux_list_new(FAUX_LIST_SORTED, FAUX_LIST_NONUNIQUE,
|
|
help_list = faux_list_new(FAUX_LIST_SORTED, FAUX_LIST_NONUNIQUE,
|
|
help_compare, help_kcompare, help_free);
|
|
help_compare, help_kcompare, help_free);
|
|
|
|
|