| File src/hstr.c changed (mode: 100644) (index 9706963..b6c149d) |
| ... |
... |
static const char *INSTALL_BASH_STRING= |
| 178 |
178 |
"\nexport HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)" |
"\nexport HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)" |
| 179 |
179 |
"\nexport PROMPT_COMMAND=\"history -a; history -n; ${PROMPT_COMMAND}\" # mem/file sync" |
"\nexport PROMPT_COMMAND=\"history -a; history -n; ${PROMPT_COMMAND}\" # mem/file sync" |
| 180 |
180 |
"\n# if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)" |
"\n# if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)" |
| 181 |
|
#if defined(__MS_WSL__) || defined(__CYGWIN__) |
|
|
181 |
|
// IMPROVE hh (win10) vs. hstr (cygwin) binary on various platforms must be resolved |
|
182 |
|
#if defined(__MS_WSL__) |
|
183 |
|
// IMPROVE commands are NOT executed on return under win10 > consider hstr_utils changes |
|
184 |
|
"\nfunction hstr_winwls {" |
|
185 |
|
"\n offset=${READLINE_POINT}" |
|
186 |
|
"\n READLINE_POINT=0" |
|
187 |
|
"\n { READLINE_LINE=$(</dev/tty hh ${READLINE_LINE:0:offset} 2>&1 1>&$hstrout); } {hstrout}>&1" |
|
188 |
|
"\n READLINE_POINT=${#READLINE_LINE}" |
|
189 |
|
"\n}" |
|
190 |
|
"\nif [[ $- =~ .*i.* ]]; then bind -x '\"\\C-r\": \"hstr_winwls\"'; fi" |
|
191 |
|
#elif defined(__CYGWIN__) |
| 182 |
192 |
"\nfunction hstr_cygwin {" |
"\nfunction hstr_cygwin {" |
| 183 |
193 |
"\n offset=${READLINE_POINT}" |
"\n offset=${READLINE_POINT}" |
| 184 |
194 |
"\n READLINE_POINT=0" |
"\n READLINE_POINT=0" |
| File src/hstr_utils.c changed (mode: 100644) (index 5d31597..bd1e1cc) |
| ... |
... |
void fill_terminal_input(char *cmd, bool padding) |
| 88 |
88 |
{ |
{ |
| 89 |
89 |
if(cmd && strlen(cmd)>0) { |
if(cmd && strlen(cmd)>0) { |
| 90 |
90 |
#if defined(__MS_WSL__) || defined(__CYGWIN__) |
#if defined(__MS_WSL__) || defined(__CYGWIN__) |
| 91 |
|
fprintf(stderr,cmd); |
|
| 92 |
|
if(padding) fprintf(stderr,"\n"); |
|
|
91 |
|
fprintf(stderr, "%s", cmd); |
|
92 |
|
if(padding) fprintf(stderr, "%s", "\n"); |
| 93 |
93 |
#else |
#else |
| 94 |
94 |
size_t size = strlen(cmd); |
size_t size = strlen(cmd); |
| 95 |
95 |
unsigned i; |
unsigned i; |