multiSSH3 6.47__tar.gz → 6.48__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. {multissh3-6.47/multiSSH3.egg-info → multissh3-6.48}/PKG-INFO +19 -5
  2. {multissh3-6.47 → multissh3-6.48}/README.md +18 -4
  3. {multissh3-6.47 → multissh3-6.48}/mssh_complete.py +211 -27
  4. {multissh3-6.47 → multissh3-6.48/multiSSH3.egg-info}/PKG-INFO +19 -5
  5. {multissh3-6.47 → multissh3-6.48}/multiSSH3.py +2 -2
  6. {multissh3-6.47 → multissh3-6.48}/tests/complete_shell_harness.py +90 -10
  7. {multissh3-6.47 → multissh3-6.48}/tests/conftest.py +26 -0
  8. {multissh3-6.47 → multissh3-6.48}/tests/data/zsh_double_quote_shapes.json +20 -8
  9. {multissh3-6.47 → multissh3-6.48}/tests/data/zsh_double_quote_shapes_6.46.json +12 -1
  10. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_cli.py +28 -4
  11. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_diagnose.py +3 -3
  12. multissh3-6.48/tests/test_complete_harness.py +90 -0
  13. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_index.py +2 -1
  14. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_keys.py +13 -7
  15. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_picker.py +16 -2
  16. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_shells.py +241 -40
  17. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_terminal.py +56 -12
  18. {multissh3-6.47 → multissh3-6.48}/tests/test_hosts_file.py +8 -1
  19. multissh3-6.47/tests/test_complete_harness.py +0 -45
  20. {multissh3-6.47 → multissh3-6.48}/LICENSE +0 -0
  21. {multissh3-6.47 → multissh3-6.48}/MANIFEST.in +0 -0
  22. {multissh3-6.47 → multissh3-6.48}/multiSSH3.egg-info/SOURCES.txt +0 -0
  23. {multissh3-6.47 → multissh3-6.48}/multiSSH3.egg-info/dependency_links.txt +0 -0
  24. {multissh3-6.47 → multissh3-6.48}/multiSSH3.egg-info/entry_points.txt +0 -0
  25. {multissh3-6.47 → multissh3-6.48}/multiSSH3.egg-info/top_level.txt +0 -0
  26. {multissh3-6.47 → multissh3-6.48}/pytest.ini +0 -0
  27. {multissh3-6.47 → multissh3-6.48}/scripts/multiSSH3 +0 -0
  28. {multissh3-6.47 → multissh3-6.48}/setup.cfg +0 -0
  29. {multissh3-6.47 → multissh3-6.48}/setup.py +0 -0
  30. {multissh3-6.47 → multissh3-6.48}/tests/bench_complete.py +0 -0
  31. {multissh3-6.47 → multissh3-6.48}/tests/data/run_command_golden.json +0 -0
  32. {multissh3-6.47 → multissh3-6.48}/tests/replay.py +0 -0
  33. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.bash3.2 +0 -0
  34. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.bash5.0 +0 -0
  35. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.bash5.1 +0 -0
  36. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.bash5.3 +0 -0
  37. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.centos7 +0 -0
  38. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.current +0 -0
  39. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.el10 +0 -0
  40. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.el9 +0 -0
  41. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.legacy +0 -0
  42. {multissh3-6.47 → multissh3-6.48}/tests/shells/Dockerfile.modern +0 -0
  43. {multissh3-6.47 → multissh3-6.48}/tests/shells/run_matrix.sh +0 -0
  44. {multissh3-6.47 → multissh3-6.48}/tests/test_cli_branches.py +0 -0
  45. {multissh3-6.47 → multissh3-6.48}/tests/test_cli_option_words.py +0 -0
  46. {multissh3-6.47 → multissh3-6.48}/tests/test_cli_processing.py +0 -0
  47. {multissh3-6.47 → multissh3-6.48}/tests/test_closed_output.py +0 -0
  48. {multissh3-6.47 → multissh3-6.48}/tests/test_color_helpers.py +0 -0
  49. {multissh3-6.47 → multissh3-6.48}/tests/test_command_terminal.py +0 -0
  50. {multissh3-6.47 → multissh3-6.48}/tests/test_compact_hostnames.py +0 -0
  51. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_blesh.py +0 -0
  52. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_context.py +0 -0
  53. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_editor.py +0 -0
  54. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_engine.py +0 -0
  55. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_eval.py +0 -0
  56. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_hosts.py +0 -0
  57. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_hoststate.py +0 -0
  58. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_lex.py +0 -0
  59. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_mssh_helpers.py +0 -0
  60. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_password_spellings.py +0 -0
  61. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_probe.py +0 -0
  62. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_start.py +0 -0
  63. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_store.py +0 -0
  64. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_suggest.py +0 -0
  65. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_untrusted.py +0 -0
  66. {multissh3-6.47 → multissh3-6.48}/tests/test_complete_zsh_options.py +0 -0
  67. {multissh3-6.47 → multissh3-6.48}/tests/test_config_cli.py +0 -0
  68. {multissh3-6.47 → multissh3-6.48}/tests/test_config_validate.py +0 -0
  69. {multissh3-6.47 → multissh3-6.48}/tests/test_config_values.py +0 -0
  70. {multissh3-6.47 → multissh3-6.48}/tests/test_control_master_config.py +0 -0
  71. {multissh3-6.47 → multissh3-6.48}/tests/test_copy_id.py +0 -0
  72. {multissh3-6.47 → multissh3-6.48}/tests/test_curses_branches.py +0 -0
  73. {multissh3-6.47 → multissh3-6.48}/tests/test_curses_event_loop.py +0 -0
  74. {multissh3-6.47 → multissh3-6.48}/tests/test_curses_tui.py +0 -0
  75. {multissh3-6.47 → multissh3-6.48}/tests/test_curses_wide_chars.py +0 -0
  76. {multissh3-6.47 → multissh3-6.48}/tests/test_expand_hostnames.py +0 -0
  77. {multissh3-6.47 → multissh3-6.48}/tests/test_file_trust.py +0 -0
  78. {multissh3-6.47 → multissh3-6.48}/tests/test_harness_smoke.py +0 -0
  79. {multissh3-6.47 → multissh3-6.48}/tests/test_helpers_extra.py +0 -0
  80. {multissh3-6.47 → multissh3-6.48}/tests/test_history_replay.py +0 -0
  81. {multissh3-6.47 → multissh3-6.48}/tests/test_host.py +0 -0
  82. {multissh3-6.47 → multissh3-6.48}/tests/test_host_validity.py +0 -0
  83. {multissh3-6.47 → multissh3-6.48}/tests/test_identities_only.py +0 -0
  84. {multissh3-6.47 → multissh3-6.48}/tests/test_ipmi_lockout_wait.py +0 -0
  85. {multissh3-6.47 → multissh3-6.48}/tests/test_ipmi_logins.py +0 -0
  86. {multissh3-6.47 → multissh3-6.48}/tests/test_key_path_home.py +0 -0
  87. {multissh3-6.47 → multissh3-6.48}/tests/test_login_drop_retry.py +0 -0
  88. {multissh3-6.47 → multissh3-6.48}/tests/test_main_lifecycle.py +0 -0
  89. {multissh3-6.47 → multissh3-6.48}/tests/test_narrow_terminal.py +0 -0
  90. {multissh3-6.47 → multissh3-6.48}/tests/test_no_hosts.py +0 -0
  91. {multissh3-6.47 → multissh3-6.48}/tests/test_option_no_effect.py +0 -0
  92. {multissh3-6.47 → multissh3-6.48}/tests/test_options_after_command.py +0 -0
  93. {multissh3-6.47 → multissh3-6.48}/tests/test_output_merge.py +0 -0
  94. {multissh3-6.47 → multissh3-6.48}/tests/test_output_robustness.py +0 -0
  95. {multissh3-6.47 → multissh3-6.48}/tests/test_packaging.py +0 -0
  96. {multissh3-6.47 → multissh3-6.48}/tests/test_password_handling.py +0 -0
  97. {multissh3-6.47 → multissh3-6.48}/tests/test_passwords_out_of_ps.py +0 -0
  98. {multissh3-6.47 → multissh3-6.48}/tests/test_run_command.py +0 -0
  99. {multissh3-6.47 → multissh3-6.48}/tests/test_run_command_branches.py +0 -0
  100. {multissh3-6.47 → multissh3-6.48}/tests/test_run_command_characterization.py +0 -0
  101. {multissh3-6.47 → multissh3-6.48}/tests/test_run_command_exit.py +0 -0
  102. {multissh3-6.47 → multissh3-6.48}/tests/test_run_on_hosts.py +0 -0
  103. {multissh3-6.47 → multissh3-6.48}/tests/test_run_on_hosts_modes.py +0 -0
  104. {multissh3-6.47 → multissh3-6.48}/tests/test_runtime_branch_matrix.py +0 -0
  105. {multissh3-6.47 → multissh3-6.48}/tests/test_runtime_dir.py +0 -0
  106. {multissh3-6.47 → multissh3-6.48}/tests/test_shared_lines.py +0 -0
  107. {multissh3-6.47 → multissh3-6.48}/tests/test_smoke_optional.py +0 -0
  108. {multissh3-6.47 → multissh3-6.48}/tests/test_ssh_error_text.py +0 -0
  109. {multissh3-6.47 → multissh3-6.48}/tests/test_ssh_timeouts.py +0 -0
  110. {multissh3-6.47 → multissh3-6.48}/tests/test_sshpass_exit.py +0 -0
  111. {multissh3-6.47 → multissh3-6.48}/tests/test_start_run_on_hosts.py +0 -0
  112. {multissh3-6.47 → multissh3-6.48}/tests/test_stopped_commands.py +0 -0
  113. {multissh3-6.47 → multissh3-6.48}/tests/test_stream_reader.py +0 -0
  114. {multissh3-6.47 → multissh3-6.48}/tests/test_streamed_output.py +0 -0
  115. {multissh3-6.47 → multissh3-6.48}/tests/test_tui_ssh_notices.py +0 -0
  116. {multissh3-6.47 → multissh3-6.48}/tests/test_unavailable_hosts.py +0 -0
  117. {multissh3-6.47 → multissh3-6.48}/tests/test_underscore_settings.py +0 -0
  118. {multissh3-6.47 → multissh3-6.48}/tests/test_waiting.py +0 -0
  119. {multissh3-6.47 → multissh3-6.48}/tests/test_wide_wrap.py +0 -0
  120. {multissh3-6.47 → multissh3-6.48}/tests/vt_grid.py +0 -0
  121. {multissh3-6.47 → multissh3-6.48}/tests/zsh_shapes_probe.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 6.47
3
+ Version: 6.48
4
4
  Summary: Run commands on multiple hosts via SSH
5
5
  Home-page: https://github.com/yufei-pan/multiSSH3
6
6
  Author: Yufei Pan
@@ -1414,19 +1414,33 @@ __DEBUG_MODE = False
1414
1414
 
1415
1415
  > `__DEBUG_MODE` is used to control whether to print host thread execution debug information to its stderr.
1416
1416
 
1417
+ ## Upgrading to 6.48 from 6.47
1418
+
1419
+ Run `mssh --completion install` again (zsh and bash): the fixes below are in the new glue. What you may notice:
1420
+
1421
+ - Fix (zsh): in a double-quoted command, a word that the command splits itself (a `CFLAGS=` value, the command string of `sh -c` or `su -c`) completes again where it holds an escaped blank or a name needs quoting, as in 6.46: `mssh h "make CFLAGS=-O2\\ -ggd<TAB>` gives `-ggdb`, and `"su -c ./lzz<TAB>` with a file `lzz x` gives the word `su -c` runs as that file. Such a word holding an escaped blank beside a `\!` or a `\\\$` gets nothing (6.46 wrote it wrong).
1422
+ - Fix (zsh): where the command splits the word and offers nothing, zsh's default file names no longer stand in: `mssh h "su -c ./lzz\\ x<TAB>` with a file `lzz xy` wrote `./lzz\\ xy`, which `su -c` runs as `./lzz` with an argument `xy`.
1423
+ - Fix (zsh): in a double-quoted command holding an expansion, `mssh h "echo $USER; make CFLAGS=-O2\\ -Isub/zz<TAB>` no longer writes the text twice: it completes, or offers nothing inside backticks and where the value holds a `\\\$`. Inside backticks a single-quoted command's value the command splits (`` `mssh h 'make CFLAGS=-Izzd\\\&x/zz<TAB> ``) offers nothing too, where it wrote the text twice.
1424
+ - Fix (zsh): a quote the command opens at the start of a word in a double-quoted command holding an expansion is read: `mssh h "echo $USER 'zz<TAB>` gives `'zzfile'" `.
1425
+ - Fix (zsh): `mssh h "cat 'a' b\\c 'zz<TAB>` completes again; 6.47 offered nothing after a backslash outside a quote of the command's own.
1426
+ - Fix (zsh): inside `$( )`, after TAB wrote the start names holding `!` share, `"zz"\!"`, a letter typed and TAB give `"zz"\!"x"`, which mssh reads as `zz!x` (6.47 wrote `"zz\!x"`, which reached mssh as `zz\!x`). On zsh 5.0.2 (EL7) history names are offered after a `\!` typed earlier in a double-quoted command, and inside `$( )` a second TAB into a directory holding `!` completes.
1427
+ - Fix (zsh): inside backticks, `dd if="~/zzd<TAB>` and then `zz<TAB>` go on into the directory.
1428
+ - Fix (bash): a typed directory holding a `$` that is there by that name goes in written for the remote shell: `mssh h cat zzd$x/zz<TAB>` gave `zzd$x/zzin`, which a shell read as `zzd/zzin`, and gives `zzd\\\$x/zzin`. Under ble.sh a bare `$x` typed there offers nothing.
1429
+ - Known (zsh, deferred to 6.49): history names in a directory typed with backslashes, beside a command's names that are no file names in a quoted word holding a `/` (`mssh h "ls /etc --col<TAB>` offers `ls`'s `--color=` alone), beside a directory a command gives with an option's text after a quote at an `=`, a history name beside a directory here, which stops TAB before the directory's `/` (`zzdir`, as in 6.47), and a quote opened partway through a word ([limitations](docs/limitations.md)).
1430
+
1417
1431
  ## Upgrading to 6.47 from 6.46
1418
1432
 
1419
1433
  Run `mssh --completion install` again (zsh): the fixes below are in the new glue. What you may notice:
1420
1434
 
1421
- - Fix (zsh): inside `$( )`, `<( )` and `>( )`, with `bang_hist` on, a name holding `!` in a double quote goes in with the `!` outside the quote, `"zz"\!"x"`: `$(mssh -f "zz<TAB>` gave mssh `zz\!x`, a file that is not there. On the line and inside backticks the spelling is as before. A letter typed behind such a word and a TAB write it as zsh does, `"zz\!x"`, as 6.46 did ([limitations](docs/limitations.md#zsh-inside---a-name-holding--reaches-mssh-with-a-backslash-after-more-is-typed-behind-it)).
1435
+ - Fix (zsh): inside `$( )`, `<( )` and `>( )`, with `bang_hist` on, a name holding `!` in a double quote goes in with the `!` outside the quote, `"zz"\!"x"`: `$(mssh -f "zz<TAB>` gave mssh `zz\!x`, a file that is not there. On the line and inside backticks the spelling is as before. A letter typed behind such a word and a TAB write it as zsh does, `"zz\!x"`, as 6.46 did (fixed in 6.48).
1422
1436
  - Change (zsh): a double-quoted command is split into words by the glue, not by zsh's `compset -q`, which read its backslashes wrong: `mssh h "grep \"a b\" zz<TAB>` gave `zzfilezz` and now gives `zzfile`, and TAB goes on into a directory written for the remote shell (`zzd$x`, ``zzd`x``, `zzd&x`). The quote stays open after a name, as before.
1423
1437
  - Fix (zsh): inside backticks, TAB goes on into such a directory in a quoted command, a double-quoted word holding an expansion and after a quote at an `=` (`` `mssh h dd if="zzd<TAB>zz<TAB> ``).
1424
1438
  - Fix (zsh): a value the command splits after a quote at an `=` keeps the quote: `mssh h make CFLAGS="-ggd<TAB>` gave `CFLAGS=-ggdb` and now gives `CFLAGS="-ggdb`, the quote left open, as in a quoted command, and its names are written for the remote shell (a directory `zz$v` reaches the remote shell as `zz$v`; 6.46 gave it `zz\$v`). `mssh h make CFLAGS="<TAB>` now lists gcc's options (what zsh completes a `CFLAGS` value with), which `CFLAGS=<TAB>` already did in 6.46: that is a long list, which zsh asks about first.
1425
1439
  - Fix (zsh): a `~/` typed after `dd`'s `=` stays as typed, so the remote shell gets the `~`: 6.46 wrote this machine's home path there (`mssh h dd if=~/zz<TAB>`, `dd if="~/zz`, `"dd if=~/zz`), and for a typed `\~`, which is now written as `~`. A `~name/` stays as typed in a quoted command (`mssh h "dd if=~bin/ba<TAB>`); outside one it is expanded, as in 6.46.
1426
- - Fix (zsh): beside the command's file names, mssh's history names are offered in a quoted command's word holding a `/`, a double-quoted word holding an expansion, and after a quote at an `=` (`mssh h "cat sub/zz<TAB>` with `mssh h "cat sub/zzremote"`, a quoted argument, in history; `cat sub/zzremote` typed as words is not offered beside a local name there). Not yet beside names that are no file names or a directory with an option's text, quoted or not ([limitations](docs/limitations.md#zsh-in-a-quoted-word-holding-a--no-history-name-beside-a-commands-names-that-are-no-file-names)), or in a directory typed with backslashes ([limitations](docs/limitations.md#zsh-in-a-directory-typed-with-backslashes-no-history-names-beside-the-local-ones)).
1440
+ - Fix (zsh): beside the command's file names, mssh's history names are offered in a quoted command's word holding a `/`, a double-quoted word holding an expansion, and after a quote at an `=` (`mssh h "cat sub/zz<TAB>` with `mssh h "cat sub/zzremote"`, a quoted argument, in history; `cat sub/zzremote` typed as words is not offered beside a local name there). Not yet beside names that are no file names in a quoted word holding a `/`, or a directory with an option's text after a quote at an `=` ([limitations](docs/limitations.md#zsh-in-a-quoted-word-holding-a--no-history-name-beside-a-commands-names-that-are-no-file-names)), or in a directory typed with backslashes ([limitations](docs/limitations.md#zsh-in-a-directory-typed-with-backslashes-no-history-names-beside-the-local-ones)).
1427
1441
  - Fix (zsh): in a command inside an open `<(` or `>(`, a double-quoted word holding an expansion is completed, not expanded, as inside `$(`.
1428
1442
  - Change (zsh): TAB no longer escapes a `!` typed bare earlier in a double-quoted command (`mssh h "echo a!b zz<TAB>`): zsh expands it on Enter, as without TAB. A `\!` typed there stays as typed. Inside `$( )`, zsh's own TAB expands such a `!b` from history first, or drops it when no history line matches (with any command, with or without mssh; `setopt no_bang_hist` avoids it; [limitations](docs/limitations.md#zsh-tab-inside-a-command-substitution-expands-a-bare-b-from-history)).
1429
- - Known (zsh, deferred to 6.48): a few shapes of the above are not done yet, among them a quote opened inside a double-quoted word holding an expansion, an escaped blank or a name that needs quoting in a word the command splits itself (`mssh h "make CFLAGS=-O2\\ -ggd<TAB>`, `"sh -c ls\\ zz<TAB>`, and `"su -c ./lzz<TAB>` with a file `lzz x` stay as typed, where 6.46 completed them; for `su -c` and a file that is not executable, 6.46's word on zsh 5.0.2 was one that `su -c` splits), and two cases on zsh 5.0.2: the entries marked `deferred (6.48)` in [limitations](docs/limitations.md) list them.
1443
+ - Known (zsh, deferred to 6.48): a few shapes of the above are not done yet, among them a quote opened inside a double-quoted word holding an expansion, an escaped blank or a name that needs quoting in a word the command splits itself (`mssh h "make CFLAGS=-O2\\ -ggd<TAB>`, `"sh -c ls\\ zz<TAB>`, and `"su -c ./lzz<TAB>` with a file `lzz x` stay as typed, where 6.46 completed them; for `su -c` and a file that is not executable, 6.46's word on zsh 5.0.2 was one that `su -c` splits), and two cases on zsh 5.0.2: 6.47's [limitations](docs/limitations.md) listed them as `deferred (6.48)`; 6.48 fixes them, but for five, now deferred to 6.49 or waiting on a zsh fix.
1430
1444
 
1431
1445
  ## Upgrading to 6.46 from 6.45
1432
1446
 
@@ -1435,7 +1449,7 @@ Run `mssh --completion install` again (zsh): the fixes below are in the new glue
1435
1449
  - Fix (zsh): a quote after a plain name's `=` stays, as after a remote option's: `mssh h dd if="zz<TAB>` gave `if=zzfile ` and now gives `if="zzfile" `, `make VAR="zz<TAB>` the same; beside another name TAB no longer takes the quote back (`if="zz` stayed `if=zz`).
1436
1450
  - Fix (zsh): inside backticks, a name that needs quoting is offered again, written for the extra reading backticks get: with a file `zzs$v`, `` `mssh h cat zz<TAB> `` gives `` `mssh h cat zzs\\\\\\\$v ``, and the remote shell gets `cat zzs$v`, as in `$( )`. Also in quoted commands and arguments, after `--output="` and `if="`, history names, and mssh's own file options: `` `mssh -f zz<TAB> `` gave `zzs\$v`, so mssh got `-f zzs`, and now gives `zzs\\\$v`. TAB goes on into such a directory (`` `mssh h cat zzd<TAB>zz<TAB> `` for `zzd&x/zzin`), except in a quoted command, a double-quoted word holding an expansion, or after a quote at an `=` (fixed in 6.47).
1437
1451
  - Fix (zsh): a backtick in single quotes, `$'...'` or after a backslash no longer counts as an open one: `` mssh h echo '`' zz<TAB> `` offers `zzs$v` again, as 6.44 did.
1438
- - Fix (zsh): in a word holding a `/`, mssh's history names are offered beside the command's own names: with `sub/zzlocal` here and `cat sub/zzremote` in history, `mssh h cat sub/zz<TAB>` stays as typed, and `r<TAB>` gives `sub/zzremote`. Also in `cat "sub/zz`, `sort --output=sub/zz` and `~/.zz`. Not yet in a quoted command, a double-quoted word holding an expansion or after a quote at an `=`, where they are offered when the command offers nothing, as in 6.45 (6.47 offers them there beside file names).
1452
+ - Fix (zsh): in a word holding a `/`, mssh's history names are offered beside the command's own names: with `sub/zzlocal` here and `mssh h "cat sub/zzremote"` in history, `mssh h cat sub/zz<TAB>` stays as typed, and `r<TAB>` gives `sub/zzremote`. Also in `cat "sub/zz`, `sort --output=sub/zz` and `~/.zz`. Not yet in a quoted command, a double-quoted word holding an expansion or after a quote at an `=`, where they are offered when the command offers nothing, as in 6.45 (6.47 offers them there beside file names).
1439
1453
  - Known (zsh, deferred to 6.47): inside `$(`, with `bang_hist` on (zsh's default), a double-quoted name holding `!` reaches mssh as `\!`: `$(mssh -f "zz<TAB>` for a file `zz!x` gives mssh `-f zz\!x`. On the line and inside backticks it reaches mssh as `zz!x`. 6.45 does the same, except after a quote at an `=` (`$(mssh h dd if="zz<TAB>`), where 6.45 dropped the quote and mssh got `if=zz!x` (fixed in 6.47).
1440
1454
  - Known (zsh, deferred to 6.47): a value that the command's completion splits after a quote at an `=` loses the quote, as in 6.45: `mssh h make CFLAGS="-ggd<TAB>` gives `CFLAGS=-ggdb`. With a history name for it the quote stays, except for a value holding a `/` with a local name beside it (fixed in 6.47).
1441
1455
  - Known (zsh, deferred to 6.47): in a double-quoted command holding `\"`, TAB puts the name after the typed word: `mssh h "grep \"a b\" zz<TAB>` gives `zzfilezz`, as in 6.45 and zsh's own `compset -q` (fixed in 6.47).
@@ -1388,19 +1388,33 @@ __DEBUG_MODE = False
1388
1388
 
1389
1389
  > `__DEBUG_MODE` is used to control whether to print host thread execution debug information to its stderr.
1390
1390
 
1391
+ ## Upgrading to 6.48 from 6.47
1392
+
1393
+ Run `mssh --completion install` again (zsh and bash): the fixes below are in the new glue. What you may notice:
1394
+
1395
+ - Fix (zsh): in a double-quoted command, a word that the command splits itself (a `CFLAGS=` value, the command string of `sh -c` or `su -c`) completes again where it holds an escaped blank or a name needs quoting, as in 6.46: `mssh h "make CFLAGS=-O2\\ -ggd<TAB>` gives `-ggdb`, and `"su -c ./lzz<TAB>` with a file `lzz x` gives the word `su -c` runs as that file. Such a word holding an escaped blank beside a `\!` or a `\\\$` gets nothing (6.46 wrote it wrong).
1396
+ - Fix (zsh): where the command splits the word and offers nothing, zsh's default file names no longer stand in: `mssh h "su -c ./lzz\\ x<TAB>` with a file `lzz xy` wrote `./lzz\\ xy`, which `su -c` runs as `./lzz` with an argument `xy`.
1397
+ - Fix (zsh): in a double-quoted command holding an expansion, `mssh h "echo $USER; make CFLAGS=-O2\\ -Isub/zz<TAB>` no longer writes the text twice: it completes, or offers nothing inside backticks and where the value holds a `\\\$`. Inside backticks a single-quoted command's value the command splits (`` `mssh h 'make CFLAGS=-Izzd\\\&x/zz<TAB> ``) offers nothing too, where it wrote the text twice.
1398
+ - Fix (zsh): a quote the command opens at the start of a word in a double-quoted command holding an expansion is read: `mssh h "echo $USER 'zz<TAB>` gives `'zzfile'" `.
1399
+ - Fix (zsh): `mssh h "cat 'a' b\\c 'zz<TAB>` completes again; 6.47 offered nothing after a backslash outside a quote of the command's own.
1400
+ - Fix (zsh): inside `$( )`, after TAB wrote the start names holding `!` share, `"zz"\!"`, a letter typed and TAB give `"zz"\!"x"`, which mssh reads as `zz!x` (6.47 wrote `"zz\!x"`, which reached mssh as `zz\!x`). On zsh 5.0.2 (EL7) history names are offered after a `\!` typed earlier in a double-quoted command, and inside `$( )` a second TAB into a directory holding `!` completes.
1401
+ - Fix (zsh): inside backticks, `dd if="~/zzd<TAB>` and then `zz<TAB>` go on into the directory.
1402
+ - Fix (bash): a typed directory holding a `$` that is there by that name goes in written for the remote shell: `mssh h cat zzd$x/zz<TAB>` gave `zzd$x/zzin`, which a shell read as `zzd/zzin`, and gives `zzd\\\$x/zzin`. Under ble.sh a bare `$x` typed there offers nothing.
1403
+ - Known (zsh, deferred to 6.49): history names in a directory typed with backslashes, beside a command's names that are no file names in a quoted word holding a `/` (`mssh h "ls /etc --col<TAB>` offers `ls`'s `--color=` alone), beside a directory a command gives with an option's text after a quote at an `=`, a history name beside a directory here, which stops TAB before the directory's `/` (`zzdir`, as in 6.47), and a quote opened partway through a word ([limitations](docs/limitations.md)).
1404
+
1391
1405
  ## Upgrading to 6.47 from 6.46
1392
1406
 
1393
1407
  Run `mssh --completion install` again (zsh): the fixes below are in the new glue. What you may notice:
1394
1408
 
1395
- - Fix (zsh): inside `$( )`, `<( )` and `>( )`, with `bang_hist` on, a name holding `!` in a double quote goes in with the `!` outside the quote, `"zz"\!"x"`: `$(mssh -f "zz<TAB>` gave mssh `zz\!x`, a file that is not there. On the line and inside backticks the spelling is as before. A letter typed behind such a word and a TAB write it as zsh does, `"zz\!x"`, as 6.46 did ([limitations](docs/limitations.md#zsh-inside---a-name-holding--reaches-mssh-with-a-backslash-after-more-is-typed-behind-it)).
1409
+ - Fix (zsh): inside `$( )`, `<( )` and `>( )`, with `bang_hist` on, a name holding `!` in a double quote goes in with the `!` outside the quote, `"zz"\!"x"`: `$(mssh -f "zz<TAB>` gave mssh `zz\!x`, a file that is not there. On the line and inside backticks the spelling is as before. A letter typed behind such a word and a TAB write it as zsh does, `"zz\!x"`, as 6.46 did (fixed in 6.48).
1396
1410
  - Change (zsh): a double-quoted command is split into words by the glue, not by zsh's `compset -q`, which read its backslashes wrong: `mssh h "grep \"a b\" zz<TAB>` gave `zzfilezz` and now gives `zzfile`, and TAB goes on into a directory written for the remote shell (`zzd$x`, ``zzd`x``, `zzd&x`). The quote stays open after a name, as before.
1397
1411
  - Fix (zsh): inside backticks, TAB goes on into such a directory in a quoted command, a double-quoted word holding an expansion and after a quote at an `=` (`` `mssh h dd if="zzd<TAB>zz<TAB> ``).
1398
1412
  - Fix (zsh): a value the command splits after a quote at an `=` keeps the quote: `mssh h make CFLAGS="-ggd<TAB>` gave `CFLAGS=-ggdb` and now gives `CFLAGS="-ggdb`, the quote left open, as in a quoted command, and its names are written for the remote shell (a directory `zz$v` reaches the remote shell as `zz$v`; 6.46 gave it `zz\$v`). `mssh h make CFLAGS="<TAB>` now lists gcc's options (what zsh completes a `CFLAGS` value with), which `CFLAGS=<TAB>` already did in 6.46: that is a long list, which zsh asks about first.
1399
1413
  - Fix (zsh): a `~/` typed after `dd`'s `=` stays as typed, so the remote shell gets the `~`: 6.46 wrote this machine's home path there (`mssh h dd if=~/zz<TAB>`, `dd if="~/zz`, `"dd if=~/zz`), and for a typed `\~`, which is now written as `~`. A `~name/` stays as typed in a quoted command (`mssh h "dd if=~bin/ba<TAB>`); outside one it is expanded, as in 6.46.
1400
- - Fix (zsh): beside the command's file names, mssh's history names are offered in a quoted command's word holding a `/`, a double-quoted word holding an expansion, and after a quote at an `=` (`mssh h "cat sub/zz<TAB>` with `mssh h "cat sub/zzremote"`, a quoted argument, in history; `cat sub/zzremote` typed as words is not offered beside a local name there). Not yet beside names that are no file names or a directory with an option's text, quoted or not ([limitations](docs/limitations.md#zsh-in-a-quoted-word-holding-a--no-history-name-beside-a-commands-names-that-are-no-file-names)), or in a directory typed with backslashes ([limitations](docs/limitations.md#zsh-in-a-directory-typed-with-backslashes-no-history-names-beside-the-local-ones)).
1414
+ - Fix (zsh): beside the command's file names, mssh's history names are offered in a quoted command's word holding a `/`, a double-quoted word holding an expansion, and after a quote at an `=` (`mssh h "cat sub/zz<TAB>` with `mssh h "cat sub/zzremote"`, a quoted argument, in history; `cat sub/zzremote` typed as words is not offered beside a local name there). Not yet beside names that are no file names in a quoted word holding a `/`, or a directory with an option's text after a quote at an `=` ([limitations](docs/limitations.md#zsh-in-a-quoted-word-holding-a--no-history-name-beside-a-commands-names-that-are-no-file-names)), or in a directory typed with backslashes ([limitations](docs/limitations.md#zsh-in-a-directory-typed-with-backslashes-no-history-names-beside-the-local-ones)).
1401
1415
  - Fix (zsh): in a command inside an open `<(` or `>(`, a double-quoted word holding an expansion is completed, not expanded, as inside `$(`.
1402
1416
  - Change (zsh): TAB no longer escapes a `!` typed bare earlier in a double-quoted command (`mssh h "echo a!b zz<TAB>`): zsh expands it on Enter, as without TAB. A `\!` typed there stays as typed. Inside `$( )`, zsh's own TAB expands such a `!b` from history first, or drops it when no history line matches (with any command, with or without mssh; `setopt no_bang_hist` avoids it; [limitations](docs/limitations.md#zsh-tab-inside-a-command-substitution-expands-a-bare-b-from-history)).
1403
- - Known (zsh, deferred to 6.48): a few shapes of the above are not done yet, among them a quote opened inside a double-quoted word holding an expansion, an escaped blank or a name that needs quoting in a word the command splits itself (`mssh h "make CFLAGS=-O2\\ -ggd<TAB>`, `"sh -c ls\\ zz<TAB>`, and `"su -c ./lzz<TAB>` with a file `lzz x` stay as typed, where 6.46 completed them; for `su -c` and a file that is not executable, 6.46's word on zsh 5.0.2 was one that `su -c` splits), and two cases on zsh 5.0.2: the entries marked `deferred (6.48)` in [limitations](docs/limitations.md) list them.
1417
+ - Known (zsh, deferred to 6.48): a few shapes of the above are not done yet, among them a quote opened inside a double-quoted word holding an expansion, an escaped blank or a name that needs quoting in a word the command splits itself (`mssh h "make CFLAGS=-O2\\ -ggd<TAB>`, `"sh -c ls\\ zz<TAB>`, and `"su -c ./lzz<TAB>` with a file `lzz x` stay as typed, where 6.46 completed them; for `su -c` and a file that is not executable, 6.46's word on zsh 5.0.2 was one that `su -c` splits), and two cases on zsh 5.0.2: 6.47's [limitations](docs/limitations.md) listed them as `deferred (6.48)`; 6.48 fixes them, but for five, now deferred to 6.49 or waiting on a zsh fix.
1404
1418
 
1405
1419
  ## Upgrading to 6.46 from 6.45
1406
1420
 
@@ -1409,7 +1423,7 @@ Run `mssh --completion install` again (zsh): the fixes below are in the new glue
1409
1423
  - Fix (zsh): a quote after a plain name's `=` stays, as after a remote option's: `mssh h dd if="zz<TAB>` gave `if=zzfile ` and now gives `if="zzfile" `, `make VAR="zz<TAB>` the same; beside another name TAB no longer takes the quote back (`if="zz` stayed `if=zz`).
1410
1424
  - Fix (zsh): inside backticks, a name that needs quoting is offered again, written for the extra reading backticks get: with a file `zzs$v`, `` `mssh h cat zz<TAB> `` gives `` `mssh h cat zzs\\\\\\\$v ``, and the remote shell gets `cat zzs$v`, as in `$( )`. Also in quoted commands and arguments, after `--output="` and `if="`, history names, and mssh's own file options: `` `mssh -f zz<TAB> `` gave `zzs\$v`, so mssh got `-f zzs`, and now gives `zzs\\\$v`. TAB goes on into such a directory (`` `mssh h cat zzd<TAB>zz<TAB> `` for `zzd&x/zzin`), except in a quoted command, a double-quoted word holding an expansion, or after a quote at an `=` (fixed in 6.47).
1411
1425
  - Fix (zsh): a backtick in single quotes, `$'...'` or after a backslash no longer counts as an open one: `` mssh h echo '`' zz<TAB> `` offers `zzs$v` again, as 6.44 did.
1412
- - Fix (zsh): in a word holding a `/`, mssh's history names are offered beside the command's own names: with `sub/zzlocal` here and `cat sub/zzremote` in history, `mssh h cat sub/zz<TAB>` stays as typed, and `r<TAB>` gives `sub/zzremote`. Also in `cat "sub/zz`, `sort --output=sub/zz` and `~/.zz`. Not yet in a quoted command, a double-quoted word holding an expansion or after a quote at an `=`, where they are offered when the command offers nothing, as in 6.45 (6.47 offers them there beside file names).
1426
+ - Fix (zsh): in a word holding a `/`, mssh's history names are offered beside the command's own names: with `sub/zzlocal` here and `mssh h "cat sub/zzremote"` in history, `mssh h cat sub/zz<TAB>` stays as typed, and `r<TAB>` gives `sub/zzremote`. Also in `cat "sub/zz`, `sort --output=sub/zz` and `~/.zz`. Not yet in a quoted command, a double-quoted word holding an expansion or after a quote at an `=`, where they are offered when the command offers nothing, as in 6.45 (6.47 offers them there beside file names).
1413
1427
  - Known (zsh, deferred to 6.47): inside `$(`, with `bang_hist` on (zsh's default), a double-quoted name holding `!` reaches mssh as `\!`: `$(mssh -f "zz<TAB>` for a file `zz!x` gives mssh `-f zz\!x`. On the line and inside backticks it reaches mssh as `zz!x`. 6.45 does the same, except after a quote at an `=` (`$(mssh h dd if="zz<TAB>`), where 6.45 dropped the quote and mssh got `if=zz!x` (fixed in 6.47).
1414
1428
  - Known (zsh, deferred to 6.47): a value that the command's completion splits after a quote at an `=` loses the quote, as in 6.45: `mssh h make CFLAGS="-ggd<TAB>` gives `CFLAGS=-ggdb`. With a history name for it the quote stays, except for a value holding a `/` with a local name beside it (fixed in 6.47).
1415
1429
  - Known (zsh, deferred to 6.47): in a double-quoted command holding `\"`, TAB puts the name after the typed word: `mssh h "grep \"a b\" zz<TAB>` gives `zzfilezz`, as in 6.45 and zsh's own `compset -q` (fixed in 6.47).
@@ -21,7 +21,7 @@ try:
21
21
  except ImportError: # not POSIX: the shells are, so nothing starts the detached processes there
22
22
  fcntl = None
23
23
 
24
- version = '0.20'
24
+ version = '0.21'
25
25
  __version__ = version
26
26
  PROTOCOL = 'MSSHC1'
27
27
  MSSH_NAMES = ('mssh', 'mssh3', 'multissh', 'multissh3', 'multiSSH3')
@@ -5975,11 +5975,17 @@ _mssh_complete_head() {
5975
5975
  (( _mssh_complete_ble )) && [[ -n ${COMPS+set} ]] && _mssh_complete_value=${COMPS#"${progcomp_prefix-}"}
5976
5976
  [[ $_mssh_complete_value == '~'* ]] || _mssh_complete_bare=0
5977
5977
  fi
5978
- # (a directory holding one; the word itself when it is one, a ~user or a $VAR being typed: a $ in a name is the name's)
5978
+ # (a directory holding one; the word itself when it is one, a ~user or a $VAR being typed: a $ in a name is the name's.
5979
+ # Not a $ or a backtick in directories that are there as written, zzd$x/: bash's completion reads them so whenever they
5980
+ # are, and its names are of that directory, which goes in written as the remote shell's word, as one holding a & does. A leading ~/
5981
+ # is tested as this shell's home: the names are this machine's)
5982
+ local -i _mssh_complete_literal=0
5983
+ _mssh_complete_unescape "${1%/*}"
5984
+ [[ $1 == */* && -d ${_mssh_complete_value/#'~/'/$HOME/} ]] && _mssh_complete_literal=1
5979
5985
  while [[ $_mssh_complete_part == */* ]]; do
5980
5986
  _mssh_complete_one=${_mssh_complete_part%%/*}
5981
5987
  _mssh_complete_seen+=$_mssh_complete_one
5982
- if [[ ${_mssh_complete_one//\\?/} == *[\$\`]* || ( $_mssh_complete_seen == "$_mssh_complete_one" && $_mssh_complete_one == '~'* ) ]]; then
5988
+ if [[ $_mssh_complete_literal == 0 && ${_mssh_complete_one//\\?/} == *[\$\`]* || ( $_mssh_complete_seen == "$_mssh_complete_one" && $_mssh_complete_one == '~'* ) ]]; then
5983
5989
  _mssh_complete_kept=$_mssh_complete_seen
5984
5990
  fi
5985
5991
  _mssh_complete_part=${_mssh_complete_part#*/}
@@ -7281,6 +7287,13 @@ _mssh() {
7281
7287
  local -i _mssh_complete_texts_beside=0
7282
7288
  local _mssh_complete_texts_typed= _mssh_complete_texts_read= _mssh_complete_tilde= _mssh_complete_split_typed= _mssh_complete_typed_last=
7283
7289
  local _mssh_complete_dq_quote= _mssh_complete_dq_typed=
7290
+ # (a quote the command opened in the word at the cursor, in a double-quoted command holding an expansion: ' or ", _mssh_complete_in_word)
7291
+ local _mssh_complete_inner=
7292
+ # (a word of a quoted command that the command's completion splits itself, or that holds an escaped blank: 1 after the first pass, 2
7293
+ # in the second, which hands it to compset -q. See below, after _mssh_complete_in_word names)
7294
+ local -i _mssh_complete_resplit=0
7295
+ # (the word at the cursor in the spelling the second pass gives zsh, when it may take it: _mssh_complete_in_word)
7296
+ local _mssh_complete_pass2=
7284
7297
  # (inside backticks a line is read once more than in $( ): see _mssh_complete_tick)
7285
7298
  _mssh_complete_tick_open "$LBUFFER" && _mssh_complete_ticked=1
7286
7299
  local _mssh_complete_was_ipre=$IPREFIX _mssh_complete_was_pre=$PREFIX
@@ -7300,10 +7313,23 @@ _mssh() {
7300
7313
  else
7301
7314
  _mssh_complete_lead=
7302
7315
  fi
7316
+ # (zsh 5.0.2 keeps the backslash of a \! typed in a double quote it keeps in PREFIX, where 5.5.1 and later read it as ! with bang_hist
7317
+ # on, as the line runs it: read so here, the glue meets what it meets there, and the engine finds the history names typed with it)
7318
+ (( ! _mssh_complete_dq )) && [[ $_mssh_complete_open == \" && $_mssh_complete_compsys_options[banghist] == on && $ZSH_VERSION == (4.*|5.0.*) ]] &&
7319
+ PREFIX=${PREFIX//\\\!/\!}
7303
7320
  # (inside $( ) with bang_hist on, a ! that goes in a double quote goes in outside it: _mssh_complete_banged. Not when the text typed
7304
7321
  # holds one: zsh writes such a word again from its quote on, as it reads it)
7305
7322
  local -i _mssh_complete_bang=0
7306
7323
  [[ $_mssh_complete_compsys_options[banghist] == on && $PREFIX != *\!* ]] && _mssh_complete_paren_open "$LBUFFER" && _mssh_complete_bang=1
7324
+ # (a word typed so, its ! outside the double quote, "zz"\!"x, as a TAB before wrote it: zsh reads it zz!x, and wrote it again from its
7325
+ # quote on as zz\!x, whose backslash stays inside $( ). Its names are written so too, and zsh matches them with PREFIX as typed
7326
+ # (_mssh_complete_compadd). Not in a quoted command, nor in a word holding a /)
7327
+ local _mssh_complete_bang_typed=
7328
+ if (( ! _mssh_complete_bang && ! _mssh_complete_dq )) && [[ $_mssh_complete_compsys_options[banghist] == on && $_mssh_complete_open == \" &&
7329
+ -z $SUFFIX && $_mssh_complete_word == \"*\"\\\!\"* && $_mssh_complete_word != */* ]] && _mssh_complete_paren_open "$LBUFFER"; then
7330
+ _mssh_complete_bang=1
7331
+ _mssh_complete_bang_typed=${_mssh_complete_word#\"}
7332
+ fi
7307
7333
  _mssh_complete_before="${(j: :)words[1,CURRENT-1]} $_mssh_complete_lead${_mssh_complete_open}$PREFIX"
7308
7334
  _mssh_complete_after="$SUFFIX ${(j: :)words[CURRENT+1,-1]}"
7309
7335
  _mssh_complete_read_locale
@@ -7375,6 +7401,10 @@ _mssh() {
7375
7401
  ;;
7376
7402
  esac
7377
7403
  done
7404
+ if (( _mssh_complete_qcommand )) && [[ -n $_mssh_complete_bang_typed ]]; then
7405
+ _mssh_complete_bang=0
7406
+ _mssh_complete_bang_typed=
7407
+ fi
7378
7408
  # the completion functions below run in those options again: under zsh's defaults _arguments misreads
7379
7409
  # its specs, and a glob in _files that matches nothing aborts the completion
7380
7410
  for _mssh_complete_name in ${(k)_mssh_complete_compsys_options}; do
@@ -7388,6 +7418,10 @@ _mssh() {
7388
7418
  # cursor inside the word. Not when the command's own word at the cursor is inside a quote it opened (mssh h "cat 'zz, "cat \"zz,
7389
7419
  # "echo \`cat zz): that stays with compset -q, which reads that quote
7390
7420
  _mssh_complete_texts_read=$PREFIX
7421
+ # (what the second pass puts back: see below)
7422
+ local -i _mssh_complete_was_bang=$_mssh_complete_bang
7423
+ local -a _mssh_complete_was_texts
7424
+ _mssh_complete_was_texts=("${_mssh_complete_texts[@]}")
7391
7425
  if (( _mssh_complete_delegating && _mssh_complete_qcommand && ! _mssh_complete_dq )) && [[ $_mssh_complete_open == \" && -z $SUFFIX ]]; then
7392
7426
  _mssh_complete_read=$PREFIX
7393
7427
  (( _mssh_complete_ticked )) && _mssh_complete_tick_read "$PREFIX"
@@ -7452,6 +7486,16 @@ _mssh() {
7452
7486
  # (how many names there are with mssh's own words in: _mssh_complete_compadd leaves out a split value's beside them)
7453
7487
  _mssh_complete_texts_in=$compstate[nmatches]
7454
7488
  _mssh_complete_in_word names
7489
+ # (a word of a quoted command whose quote zsh keeps, which the command's completion splits itself with its own compset -q (_gcc's for
7490
+ # make CFLAGS=, _cmdstring's for sh -c), or which holds an escaped blank: zsh then holds two quote levels, the command's and the double
7491
+ # quote, and the remote shell's, which the glue stands for, would lie between them. Where the second pass may take the word
7492
+ # (_mssh_complete_pass2) the first pass adds nothing there; with nothing else in, the word goes through compset -q in a second pass,
7493
+ # as in 6.46, the words before it as the glue split them, so zsh reads and writes every level itself (_mssh_complete_in_word))
7494
+ if (( _mssh_complete_resplit == 1 && compstate[nmatches] == _mssh_complete_texts_in )); then
7495
+ _mssh_complete_resplit=2
7496
+ _mssh_complete_dq_parts=()
7497
+ _mssh_complete_in_word names
7498
+ fi
7455
7499
  (( $#_mssh_complete_split )) && _mssh_complete_add_split
7456
7500
  (( ${#_mssh_complete_texts} )) && _mssh_complete_add_texts after
7457
7501
  # nothing offered: what zsh offers for a command it has no completion for, file names (bash's
@@ -7586,12 +7630,8 @@ _mssh_complete_in_word() {
7586
7630
  if (( _mssh_complete_delegating && _mssh_complete_qcommand && ! _mssh_complete_dq )) && [[ -n $_mssh_complete_open ]]; then
7587
7631
  # (zsh's own compset -q (5.0.2 to 5.9) writes outside its memory for a double-quoted word that holds a backslash inside a quote of
7588
7632
  # its own, "grep 'a\.b or "cat \"a\\b, with or without mssh, and the shell can end there (5.9: malloc(): invalid size). Nothing is
7589
- # offered where the text holds a backslash after such a quote, other than the one of \$, \` or \", which zsh reads. Coarser than
7590
- # zsh's fault: "cat 'a' b\\c 'zz is declined too)
7591
- if [[ $_mssh_complete_open == \" ]]; then
7592
- _mssh_complete_read=${${PREFIX//\\[\$\`]}//\\\"/\'}
7593
- [[ $_mssh_complete_read == *\'*\\* ]] && return 0
7594
- fi
7633
+ # offered there: _mssh_complete_qfault)
7634
+ [[ $_mssh_complete_open == \" ]] && _mssh_complete_qfault "$PREFIX" && return 0
7595
7635
  compset -q
7596
7636
  fi
7597
7637
  # (inside backticks, a word whose directories hold a backslash is read once more first, as this shell will read the line:
@@ -7613,7 +7653,11 @@ _mssh_complete_in_word() {
7613
7653
  if (( _mssh_complete_delegating )); then
7614
7654
  _mssh_complete_dq_ipre=$(( $#QIPREFIX + $#IPREFIX + $#_mssh_complete_lead + 1 ))
7615
7655
  _mssh_complete_dq_read "$_mssh_complete_read"
7616
- PREFIX=$_mssh_complete_lead${(q)_mssh_complete_read}
7656
+ # (a ~/ typed at its start stays a ~ the command's completion expands, dd if="~/zzd, as zsh holds it in $( ): quoted, it named a
7657
+ # directory ~ here, and a second TAB in a directory there found nothing)
7658
+ _mssh_complete_value=${(q)_mssh_complete_read}
7659
+ [[ $_mssh_complete_read == \~* && $_mssh_complete_value == \\\~* ]] && _mssh_complete_value=${_mssh_complete_value#\\}
7660
+ PREFIX=$_mssh_complete_lead$_mssh_complete_value
7617
7661
  else
7618
7662
  _mssh_complete_dq_ipre=$(( $#QIPREFIX + $#IPREFIX ))
7619
7663
  PREFIX=$_mssh_complete_read
@@ -7631,7 +7675,9 @@ _mssh_complete_in_word() {
7631
7675
  _mssh_complete_dq_read "$_mssh_complete_read"
7632
7676
  if (( _mssh_complete_qcommand )); then
7633
7677
  _mssh_complete_fields=("${(z)_mssh_complete_read}")
7634
- [[ $PREFIX == *[[:space:]] ]] && _mssh_complete_fields+=('')
7678
+ # (a blank at the end starts a new word, unless it is escaped: then it ends the last word, which (z) keeps it in, CFLAGS=-Isub/zz\\\ ,
7679
+ # and the command's names for an empty word went in after it)
7680
+ [[ $PREFIX == *[[:space:]] && $_mssh_complete_fields[-1] != *[[:space:]] ]] && _mssh_complete_fields+=('')
7635
7681
  # (with interactive_comments on, a word before the one at the cursor that starts with a # begins a comment, as for compset -q, which
7636
7682
  # reads the line as the shell does: nothing to offer. (z) reads a # as an ordinary character)
7637
7683
  [[ $_mssh_complete_compsys_options[interactivecomments] == on && -n ${(M)_mssh_complete_fields[1,-2]:#\#*} ]] && return 0
@@ -7648,11 +7694,69 @@ _mssh_complete_in_word() {
7648
7694
  done
7649
7695
  IPREFIX+=${PREFIX[1,$#PREFIX-_mssh_complete_offset]}
7650
7696
  PREFIX=${PREFIX[$#PREFIX-_mssh_complete_offset+1,-1]}
7697
+ # (whether the second pass may take the word, _mssh_complete_pass2 of _mssh: only a word that reads the same at every level but for
7698
+ # its escaped blanks, as zsh would write it back from its own reading. Where that is another spelling than the one typed, a \! or a
7699
+ # \\\$, the text went in twice; one the double quote reads as zsh's spelling, a blank escaped with one backslash, is given to zsh in
7700
+ # that spelling, which goes back on the line for it. A ~ as any letter: (q) quotes it anywhere, zsh's own writing only where a name
7701
+ # starts, -I~/zz. Inside backticks as zsh reads it, without their reading, which this shell gives the line after. A word holding an
7702
+ # escaped blank goes to the second pass also where the command does not split it itself)
7703
+ if (( _mssh_complete_qkept && _mssh_complete_resplit != 2 )) && [[ $_mssh_complete_what == names ]]; then
7704
+ _mssh_complete_pass2=
7705
+ _mssh_complete_read=$PREFIX
7706
+ (( _mssh_complete_ticked )) && _mssh_complete_tick_read "$PREFIX"
7707
+ _mssh_complete_dq_read "$_mssh_complete_read"
7708
+ _mssh_complete_item=${(Q)_mssh_complete_read}
7709
+ _mssh_complete_value=${${(q)_mssh_complete_item}//\\\~/\~}
7710
+ if [[ $PREFIX != *\!* && $_mssh_complete_value == "${_mssh_complete_item// /\\ }" ]]; then
7711
+ _mssh_complete_value=${${(qqq)_mssh_complete_value}[2,-2]}
7712
+ _mssh_complete_dq_read "$PREFIX"
7713
+ _mssh_complete_item=$_mssh_complete_read
7714
+ _mssh_complete_dq_read "$_mssh_complete_value"
7715
+ [[ $_mssh_complete_item == "$_mssh_complete_read" ]] && _mssh_complete_pass2=$_mssh_complete_value
7716
+ fi
7717
+ [[ -n $_mssh_complete_pass2 && $PREFIX == *\\[[:blank:]]* ]] && _mssh_complete_resplit=1
7718
+ fi
7719
+ if (( _mssh_complete_resplit == 2 )); then
7720
+ PREFIX=$_mssh_complete_pass2
7721
+ # (zsh's default file names stand in for nothing then only for a command with no completion of its own: one that splits the
7722
+ # word, su -c's, would read their word again, ./lzz\\ xy as ./lzz and xy. The command as typed, or its last path part, as
7723
+ # zsh's _dispatch looks it up: /bin/su is su)
7724
+ (( ${+_comps[$_mssh_complete_fields[1]]} || ${+_comps[${_mssh_complete_fields[1]:t}]} )) && _mssh_complete_nodefault=1
7725
+ compset -q
7726
+ words=("${(@)_mssh_complete_fields[1,-2]}" "${words[@]}")
7727
+ (( CURRENT += $#_mssh_complete_fields - 1 ))
7728
+ _mssh_complete_dq=0
7729
+ _mssh_complete_qkept=0
7730
+ _mssh_complete_bang=$_mssh_complete_was_bang
7731
+ _mssh_complete_textopts=()
7732
+ _mssh_complete_texts=("${_mssh_complete_was_texts[@]}")
7733
+ fi
7734
+ # (a quote the command opens at the start of the word at the cursor, in a double-quoted command holding an expansion,
7735
+ # "echo $USER 'zz: into IPREFIX, and the completion reads the text after it as the remote shell does inside it. The names go in
7736
+ # written for it, and close it and the double quote (_mssh_complete_inner, _mssh_complete_compadd). Not where the remote shell
7737
+ # would expand inside it: a \" quote holding a $, a backtick or a backslash. Where zsh keeps the quote, compset -q reads it)
7738
+ if (( ! _mssh_complete_qkept && _mssh_complete_resplit != 2 )); then
7739
+ _mssh_complete_read=$PREFIX
7740
+ (( _mssh_complete_ticked )) && _mssh_complete_tick_read "$_mssh_complete_read"
7741
+ _mssh_complete_dq_read "$_mssh_complete_read"
7742
+ if [[ $_mssh_complete_read == \'[^\']# ]]; then
7743
+ _mssh_complete_inner=\'
7744
+ IPREFIX+=\'
7745
+ PREFIX=${PREFIX#\'}
7746
+ elif [[ $_mssh_complete_read == \"[^\"\$\`\\]# && $PREFIX == \\\"* ]]; then
7747
+ _mssh_complete_inner=\"
7748
+ IPREFIX+=\\\"
7749
+ PREFIX=${PREFIX#\\\"}
7750
+ fi
7751
+ fi
7651
7752
  fi
7753
+ fi
7754
+ if (( _mssh_complete_dq )); then
7652
7755
  _mssh_complete_dq_parts=("${(@s:/:)PREFIX}")
7653
7756
  _mssh_complete_dq_ipre=$(( $#QIPREFIX + $#IPREFIX ))
7654
7757
  _mssh_complete_typed_last=$PREFIX
7655
- # (the text typed from the quote zsh keeps to the cursor, for _mssh_complete_compadd)
7758
+ # (QIPREFIX at the split, and the text typed from the quote zsh keeps to the cursor, for _mssh_complete_compadd: QIPREFIX grows when
7759
+ # the command's completion splits the word itself)
7656
7760
  _mssh_complete_dq_quote=$QIPREFIX
7657
7761
  _mssh_complete_dq_typed=$IPREFIX$PREFIX
7658
7762
  # (inside backticks read once more first, as above)
@@ -7660,6 +7764,8 @@ _mssh_complete_in_word() {
7660
7764
  (( _mssh_complete_ticked )) && _mssh_complete_tick_read "$PREFIX"
7661
7765
  _mssh_complete_dq_read "$_mssh_complete_read"
7662
7766
  PREFIX=$_mssh_complete_read
7767
+ # (in a quote the command opened, the text read as the remote shell reads it there, as it is, written as a word of no quote)
7768
+ [[ -n $_mssh_complete_inner ]] && PREFIX=${(q)PREFIX}
7663
7769
  # (where zsh keeps the double quote, the completion reads the word as written for that quote: the remote shell's word, written as a
7664
7770
  # name. Two rules for what the remote shell would read in it otherwise)
7665
7771
  if (( _mssh_complete_qkept )); then
@@ -7676,8 +7782,8 @@ _mssh_complete_in_word() {
7676
7782
  fi
7677
7783
  PREFIX=${${(qqq)${(Q)PREFIX}}[2,-2]}
7678
7784
  # (the command's own compset -q (gcc's, sh -c's) reads this word in the double quote, where the remote shell's \' and \" are
7679
- # quotes of its own: the same fault as above for a backslash after one, so the same test)
7680
- [[ ${${PREFIX//\\[\$\`]}//\\\"/\'} == *\'*\\* ]] && return 0
7785
+ # quotes of its own: the same fault as above for a backslash inside one, so the same test)
7786
+ _mssh_complete_qfault "$PREFIX" && return 0
7681
7787
  # (2. the ~ that zsh's completion expands where a file name starts, as it did in 6.46: at the word's start, after the = of an
7682
7788
  # option or a value, after a one-letter option. Whether the remote shell expands it there is its own (bash does after a name's =,
7683
7789
  # dd's if=~/, not after -I or an option's =; dash and zsh do not): it stays as typed. zsh's completion reads no ~ in a double
@@ -7801,6 +7907,31 @@ _mssh_complete_inner_quote() {
7801
7907
  [[ -n $_mssh_complete_quote ]]
7802
7908
  }
7803
7909
 
7910
+ _mssh_complete_qfault() {
7911
+ # whether $1, text in a double quote, holds a backslash inside a quote of its own, ' or \", other than the one of \$, \` or \", which
7912
+ # the double quote reads: zsh's own compset -q writes outside its memory for such a word (5.0.2 to 5.9, with or without mssh:
7913
+ # limitations). One after such a quote, "cat 'a' b\\c 'zz, is none
7914
+ emulate -L zsh; setopt extended_glob
7915
+ # (the names (#m) sets stay this function's: stock zsh leaves none in the shell)
7916
+ local MATCH MBEGIN MEND
7917
+ local _mssh_complete_quote= _mssh_complete_nul=$'\0'
7918
+ local -a _mssh_complete_parts
7919
+ local -i _mssh_complete_at
7920
+ [[ $1 == *\\* ]] || return 1
7921
+ # (the runs between them at the odd places, maybe empty, and at the even ones a ' or a backslash with the character after it)
7922
+ _mssh_complete_parts=("${(@ps:\0:)${1//(#m)(\\?|\\|\')/$_mssh_complete_nul$MATCH$_mssh_complete_nul}}")
7923
+ for (( _mssh_complete_at = 2; _mssh_complete_at <= $#_mssh_complete_parts; _mssh_complete_at += 2 )); do
7924
+ case $_mssh_complete_quote$_mssh_complete_parts[_mssh_complete_at] in
7925
+ (s\'|d\\\") _mssh_complete_quote= ;;
7926
+ (\') _mssh_complete_quote=s ;;
7927
+ (\\\") _mssh_complete_quote=d ;;
7928
+ ([sd]\\[\$\`\"]) ;;
7929
+ ([sd]\\*) return 0 ;;
7930
+ esac
7931
+ done
7932
+ return 1
7933
+ }
7934
+
7804
7935
  _mssh_complete_dq_read() {
7805
7936
  # $1, text typed in a double quote, as that quote reads it, into _mssh_complete_read of _mssh; a $ or a backtick stays
7806
7937
  emulate -L zsh
@@ -7867,16 +7998,23 @@ _mssh_complete_compadd() {
7867
7998
  local MATCH MBEGIN MEND
7868
7999
  local -i _mssh_complete_dq=${_mssh_complete_dq:-0} _mssh_complete_ticked=${_mssh_complete_ticked:-0}
7869
8000
  local _mssh_complete_open=${_mssh_complete_open-}
7870
- # (a compset -q of the command's own, _gcc's for make CFLAGS=, _cmdstring's for sh -c: QIPREFIX has grown since the glue's split. zsh
7871
- # then holds two quote levels, the command's and the double quote's, and the remote shell's, which the glue stands for, lies between
7872
- # them: only text that reads the same at every level goes in. The text the command moved to QIPREFIX, which zsh writes back as it is,
7873
- # must be the text typed (CFLAGS=-O2 for a typed CFLAGS=-O2\\ is not), and a name must need no quoting (below); otherwise nothing goes
7874
- # in, and zsh's default file names, which would stand in for what was left out as a plain word, do not either
7875
- # (_mssh_complete_nodefault of _mssh). Only where zsh keeps the quote (_mssh_complete_qkept): there the command is given the word
7876
- # written as a name, its blank bare. In a word holding an expansion it is given the double quote's reading, a blank still escaped,
7877
- # which goes back as the same word, as in 6.46)
8001
+ # (a compset -q of the command's own, _gcc's for make CFLAGS=, _cmdstring's for sh -c, where zsh keeps the quote of a quoted command
8002
+ # and the glue split it (_mssh_complete_qkept): QIPREFIX has grown since the split. zsh then holds two quote levels, the command's and
8003
+ # the double quote's, and the remote shell's, which the glue stands for, lies between them: only text that reads the same at every level
8004
+ # goes in here. The text the command moved to QIPREFIX, which zsh writes back as it is, must be the text typed (CFLAGS=-O2 for a typed
8005
+ # CFLAGS=-O2\\ is not), and every name must need no quoting (below). Otherwise nothing goes in from this call, zsh's default file names
8006
+ # do not stand in, which the command would read again, and _mssh takes the word through compset -q in a second pass, as in 6.46, where
8007
+ # zsh writes every level itself. In a word holding an expansion, where zsh keeps no quote, the command is given the double quote's reading,
8008
+ # a blank still escaped, which goes back as the same word, as in 6.46)
7878
8009
  local -i _mssh_complete_nested=0
7879
- (( ${_mssh_complete_qkept:-0} )) && [[ -n ${_mssh_complete_dq_typed-} && $QIPREFIX != "$_mssh_complete_dq_quote" ]] && _mssh_complete_nested=1
8010
+ (( ${_mssh_complete_qkept:-0} && ${#_mssh_complete_dq_parts} )) && [[ $QIPREFIX != "${_mssh_complete_dq_quote-}" ]] && _mssh_complete_nested=1
8011
+ # (a word the second pass may take: every call of the first pass is left for it, filters too, whose matchers left the second pass's names
8012
+ # cut back to CFLAGS=)
8013
+ if (( _mssh_complete_nested )) && [[ -n ${_mssh_complete_pass2-} ]]; then
8014
+ (( _mssh_complete_resplit )) || _mssh_complete_resplit=1
8015
+ _mssh_complete_nodefault=1
8016
+ return 1
8017
+ fi
7880
8018
  if (( _mssh_complete_nested )) && [[ $_mssh_complete_dq_typed != "${QIPREFIX#"$_mssh_complete_dq_quote"}$IPREFIX"* ]]; then
7881
8019
  _mssh_complete_nodefault=1
7882
8020
  return 1
@@ -7981,9 +8119,12 @@ _mssh_complete_compadd() {
7981
8119
  if (( ${_mssh_complete_texts_in:-0} > ${_mssh_complete_matches:-0} )) && [[ $IPREFIX != *"${_mssh_complete_lead-}"* ]]; then
7982
8120
  return 1
7983
8121
  fi
7984
- # (what closes a word of the double quote: the quote and a space, or nothing where zsh keeps the quote of a quoted command)
8122
+ # (what closes a word of the double quote: the quote and a space, or nothing where zsh keeps the quote of a quoted command; a quote the
8123
+ # command opened inside it first, _mssh_complete_inner of _mssh, as typed: ' or \")
7985
8124
  local _mssh_complete_close='" '
7986
8125
  (( ${_mssh_complete_qkept:-0} )) && _mssh_complete_close=
8126
+ [[ ${_mssh_complete_inner-} == \' ]] && _mssh_complete_close=\'$_mssh_complete_close
8127
+ [[ ${_mssh_complete_inner-} == \" ]] && _mssh_complete_close=\\\"$_mssh_complete_close
7987
8128
  (( _mssh_complete_dq )) && _mssh_complete_closing_opts=(-S "$_mssh_complete_close")
7988
8129
  # (in a quoted command's double quote zsh writes a word of -Q for that quote still: a \ is doubled, and the word is raw)
7989
8130
  (( _mssh_complete_quoted || _mssh_complete_dq )) && _mssh_complete_tickas=written
@@ -8058,7 +8199,32 @@ _mssh_complete_compadd() {
8058
8199
  # the ones before are in IPREFIX, dd's if=~/ with them, which a ~ restored there made twice. Counted with QIPREFIX: a compset -q of the
8059
8200
  # command's own, _gcc's for make CFLAGS=, moves IPREFIX there)
8060
8201
  _mssh_complete_item=${(j:/:)_mssh_complete_dq_parts[-$#_mssh_complete_parts,-2]}
8061
- IPREFIX+=${_mssh_complete_item#"${${:-$QIPREFIX$IPREFIX}[_mssh_complete_dq_ipre+1,-1]}"}/
8202
+ _mssh_complete_moved=${${:-$QIPREFIX$IPREFIX}[_mssh_complete_dq_ipre+1,-1]}
8203
+ # (where the text moved is not the start of the word typed, the directories would go in after it, the text twice: inside backticks,
8204
+ # 'make CFLAGS=-Izzd\\\&x/zz, where _gcc's compset -q moves the whole word. Nothing goes in there. In a double-quoted word holding an
8205
+ # expansion the command is given the text as the double quote reads it, and moves that, which zsh writes back as it is: the text typed
8206
+ # whose reading it is comes off, "echo $USER; make CFLAGS=-O2\\ -Isub/ with CFLAGS=-O2\ -I moved, where the double quote reads the
8207
+ # two alike. Where it reads them otherwise, \$ written back for a typed \\\$, nothing goes in)
8208
+ if [[ ${(j:/:)_mssh_complete_dq_parts} == "$_mssh_complete_moved"* ]]; then
8209
+ _mssh_complete_item=${_mssh_complete_item#"$_mssh_complete_moved"}
8210
+ else
8211
+ _mssh_complete_index=-1
8212
+ if (( _mssh_complete_dq && ! ${_mssh_complete_qkept:-0} && ! _mssh_complete_ticked )); then
8213
+ _mssh_complete_dq_read "$_mssh_complete_moved"
8214
+ if [[ $_mssh_complete_read == "$_mssh_complete_moved" ]]; then
8215
+ for (( _mssh_complete_index = $#_mssh_complete_item; _mssh_complete_index >= 0; _mssh_complete_index-- )); do
8216
+ _mssh_complete_dq_read "${_mssh_complete_item[1,_mssh_complete_index]}"
8217
+ [[ $_mssh_complete_read == "$_mssh_complete_moved" ]] && break
8218
+ done
8219
+ fi
8220
+ fi
8221
+ if (( _mssh_complete_index < 1 )); then
8222
+ _mssh_complete_nodefault=1
8223
+ return 1
8224
+ fi
8225
+ _mssh_complete_item=${_mssh_complete_item[_mssh_complete_index+1,-1]}
8226
+ fi
8227
+ IPREFIX+=$_mssh_complete_item/
8062
8228
  PREFIX=${(j:/:)${(@s:/:)PREFIX}[$#_mssh_complete_parts,-1]}
8063
8229
  _mssh_complete_opts[_mssh_complete_hidden_at]=
8064
8230
  _mssh_complete_bare[_mssh_complete_hidden_bare]=
@@ -8116,8 +8282,8 @@ _mssh_complete_compadd() {
8116
8282
  # (where zsh keeps the double quote the word is written for it, \!, \", \$ and \` read as the quote reads them: (Q) stops at a ' that
8117
8283
  # is not closed, and zz'\!x went in as zz'\\\!x)
8118
8284
  (( _mssh_complete_quoted && ${_mssh_complete_qkept:-0} )) && _mssh_complete_name=${_mssh_complete_word//(#m)\\[\\\!\$\`\"]/${MATCH[2]}}
8119
- # (in a word the command split itself, above: a name that (q) changes has a spelling for each level and went in written twice,
8120
- # sub/zz\\\\\\\\\\\\ x for a directory "zz x"; it is left out)
8285
+ # (in a word the command split itself, above, that the second pass does not take: a name that (q) changes has a spelling for each
8286
+ # level, and went in written twice, sub/zz\\\\\\\\\\\\ x for a directory "zz x": it is left out)
8121
8287
  if (( _mssh_complete_nested && ! _mssh_complete_filter )) && [[ ${(q)_mssh_complete_name} != "$_mssh_complete_name" ]]; then
8122
8288
  _mssh_complete_nodefault=1
8123
8289
  continue
@@ -8145,11 +8311,27 @@ _mssh_complete_compadd() {
8145
8311
  if (( _mssh_complete_delegating )); then
8146
8312
  # (where zsh keeps the quote, a word of -Q is written for it, not for the remote shell)
8147
8313
  (( _mssh_complete_quoted && ! ${_mssh_complete_qkept:-0} )) && _mssh_complete_value=$_mssh_complete_word || _mssh_complete_value=${(q)_mssh_complete_name}
8314
+ # (in a quote the command opened, the name as the remote shell reads it there: ' as '\'', and in a \" quote, which holds no
8315
+ # expansion, a \\ and a " escaped, $ and ` too)
8316
+ [[ ${_mssh_complete_inner-} == \' ]] && _mssh_complete_value=${_mssh_complete_name//\'/\'\\\'\'}
8317
+ if [[ ${_mssh_complete_inner-} == \" ]]; then
8318
+ _mssh_complete_value=${${(qqq)_mssh_complete_name}[2,-2]}
8319
+ # (with bang_hist on (qqq) writes each ! as \!, for zsh's history: here the remote shell reads it in its quote, where the
8320
+ # backslash would stay, so a ! goes in bare, and goes outside the double quote below, as in a ' quote)
8321
+ [[ ${_mssh_complete_compsys_options[banghist]-} == on ]] && _mssh_complete_value=${_mssh_complete_value//\\\!/\!}
8322
+ fi
8148
8323
  fi
8149
8324
  _mssh_complete_quote_in "$_mssh_complete_value"
8150
8325
  _mssh_complete_word=$_mssh_complete_inq
8151
8326
  # (a command's word, written \! by zsh for the remote shell, is \! here once; mssh's own names keep the \! zsh's history takes off)
8152
8327
  (( _mssh_complete_delegating && ! _mssh_complete_banging )) && _mssh_complete_word=${_mssh_complete_inq//\\\!/\!}
8328
+ # (in a quote the command opened the remote shell reads a ! as it is: with bang_hist on it goes outside the double quote, "\!", which
8329
+ # keeps zsh's history off it and reads as ! on the line, in $( ) and inside backticks alike (_mssh_complete_banged; in $( ) done above))
8330
+ if [[ -n ${_mssh_complete_inner-} && ${_mssh_complete_compsys_options[banghist]-} == on && $_mssh_complete_word == *\!* ]] && (( ! _mssh_complete_banging )); then
8331
+ _mssh_complete_inq=$_mssh_complete_word
8332
+ _mssh_complete_banged
8333
+ _mssh_complete_word=$_mssh_complete_inq
8334
+ fi
8153
8335
  # (a directory whose word changed: zsh's mark looks for the word as written and finds no directory: its / here, quote open)
8154
8336
  if (( _mssh_complete_file && ! _mssh_complete_shown_at )) && [[ $_mssh_complete_word != "$_mssh_complete_name" && -d $_mssh_complete_prefix$_mssh_complete_name ]]; then
8155
8337
  (( _mssh_complete_ticked )) && _mssh_complete_tick $_mssh_complete_tickas "$_mssh_complete_word"
@@ -8241,6 +8423,8 @@ _mssh_complete_compadd() {
8241
8423
  _mssh_complete_bare+=(-Q)
8242
8424
  (( _mssh_complete_suffixed )) && _mssh_complete_closing_opts=()
8243
8425
  fi
8426
+ # (a word typed with its ! outside the double quote, _mssh_complete_bang_typed of _mssh: its words, written so, start with it as typed)
8427
+ [[ -n ${_mssh_complete_bang_typed-} ]] && (( ! _mssh_complete_filter )) && PREFIX=$_mssh_complete_bang_typed
8244
8428
  (( $#_mssh_complete_closing )) && _mssh_complete_next_compadd "${_mssh_complete_bare[@]}" "${_mssh_complete_closing_opts[@]}" - "${_mssh_complete_closing[@]}" && _mssh_complete_rc=0
8245
8429
  if (( $#_mssh_complete_out || _mssh_complete_filter || ! $#_mssh_complete_closing && ! $#_mssh_complete_changed && ! $#_mssh_complete_dirs )); then
8246
8430
  _mssh_complete_next_compadd "${_mssh_complete_opts[@]}" - "${_mssh_complete_out[@]}" && _mssh_complete_rc=0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: multiSSH3
3
- Version: 6.47
3
+ Version: 6.48
4
4
  Summary: Run commands on multiple hosts via SSH
5
5
  Home-page: https://github.com/yufei-pan/multiSSH3
6
6
  Author: Yufei Pan
@@ -1414,19 +1414,33 @@ __DEBUG_MODE = False
1414
1414
 
1415
1415
  > `__DEBUG_MODE` is used to control whether to print host thread execution debug information to its stderr.
1416
1416
 
1417
+ ## Upgrading to 6.48 from 6.47
1418
+
1419
+ Run `mssh --completion install` again (zsh and bash): the fixes below are in the new glue. What you may notice:
1420
+
1421
+ - Fix (zsh): in a double-quoted command, a word that the command splits itself (a `CFLAGS=` value, the command string of `sh -c` or `su -c`) completes again where it holds an escaped blank or a name needs quoting, as in 6.46: `mssh h "make CFLAGS=-O2\\ -ggd<TAB>` gives `-ggdb`, and `"su -c ./lzz<TAB>` with a file `lzz x` gives the word `su -c` runs as that file. Such a word holding an escaped blank beside a `\!` or a `\\\$` gets nothing (6.46 wrote it wrong).
1422
+ - Fix (zsh): where the command splits the word and offers nothing, zsh's default file names no longer stand in: `mssh h "su -c ./lzz\\ x<TAB>` with a file `lzz xy` wrote `./lzz\\ xy`, which `su -c` runs as `./lzz` with an argument `xy`.
1423
+ - Fix (zsh): in a double-quoted command holding an expansion, `mssh h "echo $USER; make CFLAGS=-O2\\ -Isub/zz<TAB>` no longer writes the text twice: it completes, or offers nothing inside backticks and where the value holds a `\\\$`. Inside backticks a single-quoted command's value the command splits (`` `mssh h 'make CFLAGS=-Izzd\\\&x/zz<TAB> ``) offers nothing too, where it wrote the text twice.
1424
+ - Fix (zsh): a quote the command opens at the start of a word in a double-quoted command holding an expansion is read: `mssh h "echo $USER 'zz<TAB>` gives `'zzfile'" `.
1425
+ - Fix (zsh): `mssh h "cat 'a' b\\c 'zz<TAB>` completes again; 6.47 offered nothing after a backslash outside a quote of the command's own.
1426
+ - Fix (zsh): inside `$( )`, after TAB wrote the start names holding `!` share, `"zz"\!"`, a letter typed and TAB give `"zz"\!"x"`, which mssh reads as `zz!x` (6.47 wrote `"zz\!x"`, which reached mssh as `zz\!x`). On zsh 5.0.2 (EL7) history names are offered after a `\!` typed earlier in a double-quoted command, and inside `$( )` a second TAB into a directory holding `!` completes.
1427
+ - Fix (zsh): inside backticks, `dd if="~/zzd<TAB>` and then `zz<TAB>` go on into the directory.
1428
+ - Fix (bash): a typed directory holding a `$` that is there by that name goes in written for the remote shell: `mssh h cat zzd$x/zz<TAB>` gave `zzd$x/zzin`, which a shell read as `zzd/zzin`, and gives `zzd\\\$x/zzin`. Under ble.sh a bare `$x` typed there offers nothing.
1429
+ - Known (zsh, deferred to 6.49): history names in a directory typed with backslashes, beside a command's names that are no file names in a quoted word holding a `/` (`mssh h "ls /etc --col<TAB>` offers `ls`'s `--color=` alone), beside a directory a command gives with an option's text after a quote at an `=`, a history name beside a directory here, which stops TAB before the directory's `/` (`zzdir`, as in 6.47), and a quote opened partway through a word ([limitations](docs/limitations.md)).
1430
+
1417
1431
  ## Upgrading to 6.47 from 6.46
1418
1432
 
1419
1433
  Run `mssh --completion install` again (zsh): the fixes below are in the new glue. What you may notice:
1420
1434
 
1421
- - Fix (zsh): inside `$( )`, `<( )` and `>( )`, with `bang_hist` on, a name holding `!` in a double quote goes in with the `!` outside the quote, `"zz"\!"x"`: `$(mssh -f "zz<TAB>` gave mssh `zz\!x`, a file that is not there. On the line and inside backticks the spelling is as before. A letter typed behind such a word and a TAB write it as zsh does, `"zz\!x"`, as 6.46 did ([limitations](docs/limitations.md#zsh-inside---a-name-holding--reaches-mssh-with-a-backslash-after-more-is-typed-behind-it)).
1435
+ - Fix (zsh): inside `$( )`, `<( )` and `>( )`, with `bang_hist` on, a name holding `!` in a double quote goes in with the `!` outside the quote, `"zz"\!"x"`: `$(mssh -f "zz<TAB>` gave mssh `zz\!x`, a file that is not there. On the line and inside backticks the spelling is as before. A letter typed behind such a word and a TAB write it as zsh does, `"zz\!x"`, as 6.46 did (fixed in 6.48).
1422
1436
  - Change (zsh): a double-quoted command is split into words by the glue, not by zsh's `compset -q`, which read its backslashes wrong: `mssh h "grep \"a b\" zz<TAB>` gave `zzfilezz` and now gives `zzfile`, and TAB goes on into a directory written for the remote shell (`zzd$x`, ``zzd`x``, `zzd&x`). The quote stays open after a name, as before.
1423
1437
  - Fix (zsh): inside backticks, TAB goes on into such a directory in a quoted command, a double-quoted word holding an expansion and after a quote at an `=` (`` `mssh h dd if="zzd<TAB>zz<TAB> ``).
1424
1438
  - Fix (zsh): a value the command splits after a quote at an `=` keeps the quote: `mssh h make CFLAGS="-ggd<TAB>` gave `CFLAGS=-ggdb` and now gives `CFLAGS="-ggdb`, the quote left open, as in a quoted command, and its names are written for the remote shell (a directory `zz$v` reaches the remote shell as `zz$v`; 6.46 gave it `zz\$v`). `mssh h make CFLAGS="<TAB>` now lists gcc's options (what zsh completes a `CFLAGS` value with), which `CFLAGS=<TAB>` already did in 6.46: that is a long list, which zsh asks about first.
1425
1439
  - Fix (zsh): a `~/` typed after `dd`'s `=` stays as typed, so the remote shell gets the `~`: 6.46 wrote this machine's home path there (`mssh h dd if=~/zz<TAB>`, `dd if="~/zz`, `"dd if=~/zz`), and for a typed `\~`, which is now written as `~`. A `~name/` stays as typed in a quoted command (`mssh h "dd if=~bin/ba<TAB>`); outside one it is expanded, as in 6.46.
1426
- - Fix (zsh): beside the command's file names, mssh's history names are offered in a quoted command's word holding a `/`, a double-quoted word holding an expansion, and after a quote at an `=` (`mssh h "cat sub/zz<TAB>` with `mssh h "cat sub/zzremote"`, a quoted argument, in history; `cat sub/zzremote` typed as words is not offered beside a local name there). Not yet beside names that are no file names or a directory with an option's text, quoted or not ([limitations](docs/limitations.md#zsh-in-a-quoted-word-holding-a--no-history-name-beside-a-commands-names-that-are-no-file-names)), or in a directory typed with backslashes ([limitations](docs/limitations.md#zsh-in-a-directory-typed-with-backslashes-no-history-names-beside-the-local-ones)).
1440
+ - Fix (zsh): beside the command's file names, mssh's history names are offered in a quoted command's word holding a `/`, a double-quoted word holding an expansion, and after a quote at an `=` (`mssh h "cat sub/zz<TAB>` with `mssh h "cat sub/zzremote"`, a quoted argument, in history; `cat sub/zzremote` typed as words is not offered beside a local name there). Not yet beside names that are no file names in a quoted word holding a `/`, or a directory with an option's text after a quote at an `=` ([limitations](docs/limitations.md#zsh-in-a-quoted-word-holding-a--no-history-name-beside-a-commands-names-that-are-no-file-names)), or in a directory typed with backslashes ([limitations](docs/limitations.md#zsh-in-a-directory-typed-with-backslashes-no-history-names-beside-the-local-ones)).
1427
1441
  - Fix (zsh): in a command inside an open `<(` or `>(`, a double-quoted word holding an expansion is completed, not expanded, as inside `$(`.
1428
1442
  - Change (zsh): TAB no longer escapes a `!` typed bare earlier in a double-quoted command (`mssh h "echo a!b zz<TAB>`): zsh expands it on Enter, as without TAB. A `\!` typed there stays as typed. Inside `$( )`, zsh's own TAB expands such a `!b` from history first, or drops it when no history line matches (with any command, with or without mssh; `setopt no_bang_hist` avoids it; [limitations](docs/limitations.md#zsh-tab-inside-a-command-substitution-expands-a-bare-b-from-history)).
1429
- - Known (zsh, deferred to 6.48): a few shapes of the above are not done yet, among them a quote opened inside a double-quoted word holding an expansion, an escaped blank or a name that needs quoting in a word the command splits itself (`mssh h "make CFLAGS=-O2\\ -ggd<TAB>`, `"sh -c ls\\ zz<TAB>`, and `"su -c ./lzz<TAB>` with a file `lzz x` stay as typed, where 6.46 completed them; for `su -c` and a file that is not executable, 6.46's word on zsh 5.0.2 was one that `su -c` splits), and two cases on zsh 5.0.2: the entries marked `deferred (6.48)` in [limitations](docs/limitations.md) list them.
1443
+ - Known (zsh, deferred to 6.48): a few shapes of the above are not done yet, among them a quote opened inside a double-quoted word holding an expansion, an escaped blank or a name that needs quoting in a word the command splits itself (`mssh h "make CFLAGS=-O2\\ -ggd<TAB>`, `"sh -c ls\\ zz<TAB>`, and `"su -c ./lzz<TAB>` with a file `lzz x` stay as typed, where 6.46 completed them; for `su -c` and a file that is not executable, 6.46's word on zsh 5.0.2 was one that `su -c` splits), and two cases on zsh 5.0.2: 6.47's [limitations](docs/limitations.md) listed them as `deferred (6.48)`; 6.48 fixes them, but for five, now deferred to 6.49 or waiting on a zsh fix.
1430
1444
 
1431
1445
  ## Upgrading to 6.46 from 6.45
1432
1446
 
@@ -1435,7 +1449,7 @@ Run `mssh --completion install` again (zsh): the fixes below are in the new glue
1435
1449
  - Fix (zsh): a quote after a plain name's `=` stays, as after a remote option's: `mssh h dd if="zz<TAB>` gave `if=zzfile ` and now gives `if="zzfile" `, `make VAR="zz<TAB>` the same; beside another name TAB no longer takes the quote back (`if="zz` stayed `if=zz`).
1436
1450
  - Fix (zsh): inside backticks, a name that needs quoting is offered again, written for the extra reading backticks get: with a file `zzs$v`, `` `mssh h cat zz<TAB> `` gives `` `mssh h cat zzs\\\\\\\$v ``, and the remote shell gets `cat zzs$v`, as in `$( )`. Also in quoted commands and arguments, after `--output="` and `if="`, history names, and mssh's own file options: `` `mssh -f zz<TAB> `` gave `zzs\$v`, so mssh got `-f zzs`, and now gives `zzs\\\$v`. TAB goes on into such a directory (`` `mssh h cat zzd<TAB>zz<TAB> `` for `zzd&x/zzin`), except in a quoted command, a double-quoted word holding an expansion, or after a quote at an `=` (fixed in 6.47).
1437
1451
  - Fix (zsh): a backtick in single quotes, `$'...'` or after a backslash no longer counts as an open one: `` mssh h echo '`' zz<TAB> `` offers `zzs$v` again, as 6.44 did.
1438
- - Fix (zsh): in a word holding a `/`, mssh's history names are offered beside the command's own names: with `sub/zzlocal` here and `cat sub/zzremote` in history, `mssh h cat sub/zz<TAB>` stays as typed, and `r<TAB>` gives `sub/zzremote`. Also in `cat "sub/zz`, `sort --output=sub/zz` and `~/.zz`. Not yet in a quoted command, a double-quoted word holding an expansion or after a quote at an `=`, where they are offered when the command offers nothing, as in 6.45 (6.47 offers them there beside file names).
1452
+ - Fix (zsh): in a word holding a `/`, mssh's history names are offered beside the command's own names: with `sub/zzlocal` here and `mssh h "cat sub/zzremote"` in history, `mssh h cat sub/zz<TAB>` stays as typed, and `r<TAB>` gives `sub/zzremote`. Also in `cat "sub/zz`, `sort --output=sub/zz` and `~/.zz`. Not yet in a quoted command, a double-quoted word holding an expansion or after a quote at an `=`, where they are offered when the command offers nothing, as in 6.45 (6.47 offers them there beside file names).
1439
1453
  - Known (zsh, deferred to 6.47): inside `$(`, with `bang_hist` on (zsh's default), a double-quoted name holding `!` reaches mssh as `\!`: `$(mssh -f "zz<TAB>` for a file `zz!x` gives mssh `-f zz\!x`. On the line and inside backticks it reaches mssh as `zz!x`. 6.45 does the same, except after a quote at an `=` (`$(mssh h dd if="zz<TAB>`), where 6.45 dropped the quote and mssh got `if=zz!x` (fixed in 6.47).
1440
1454
  - Known (zsh, deferred to 6.47): a value that the command's completion splits after a quote at an `=` loses the quote, as in 6.45: `mssh h make CFLAGS="-ggd<TAB>` gives `CFLAGS=-ggdb`. With a history name for it the quote stays, except for a value holding a `/` with a local name beside it (fixed in 6.47).
1441
1455
  - Known (zsh, deferred to 6.47): in a double-quoted command holding `\"`, TAB puts the name after the typed word: `mssh h "grep \"a b\" zz<TAB>` gives `zzfilezz`, as in 6.45 and zsh's own `compset -q` (fixed in 6.47).