Skip to content

Commit

Permalink
Employ zsh bracketed paste magic
Browse files Browse the repository at this point in the history
Send $'\e[200~' and $'\e[201~' before and after long cd command.
  • Loading branch information
balta2ar committed May 23, 2016
1 parent 35ad1ab commit f17ebb8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/subshell/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,8 @@ do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt)
g_free (pcwd);
return;
}
// turn on paste mode
write_all (mc_global.tty.subshell_pty, "\x1B\x5B\x32\x30\x30\x7E", 6);

/* The initial space keeps this out of the command history (in bash
because we set "HISTCONTROL=ignorespace") */
Expand Down Expand Up @@ -1310,6 +1312,10 @@ do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt)
{
write_all (mc_global.tty.subshell_pty, "/", 1);
}

// turn off paste mode
write_all (mc_global.tty.subshell_pty, "\x1B\x5B\x32\x30\x31\x7E", 6);

write_all (mc_global.tty.subshell_pty, "\n", 1);

subshell_state = RUNNING_COMMAND;
Expand Down

0 comments on commit f17ebb8

Please sign in to comment.