Co-authored-by: Henry Beberman <henry.beberman@microsoft.com>
Fixes issue #6598 which is a crash on selection in tmux. The fix requires an update to ncurses and a patch to tmux. From the patch comments:
```
ncurses-6.4-20230408 change tparm to require cur_term, which broke tmux usage of it.
ncurses-6.4-20230423 then added tiparm_s that allows usage without cur_term.
tmux change 39d41d0810 uses tiparm_s if it exists, but cannot be cleanly applied to tmux tag 3.2a.
That change uses a config setting to created #defines to determine which version of tparm it should use, and only conditionally uses tiparm_s, because it needs to be backwards compatible with previous versions of ncurses.
But to use that, we would need to get the actual source as it appears in github, rather than the released version (they are different downloads: see https://github.com/tmux/tmux/releases).
Fortunately, we have the luxery of forcing tmux to use a version of ncurses that has the function we want (see above).
Given all this, this patch takes the change to use tiparm_s, removes the conditional compilation portion so it always uses tiparm_s and applies it to the code as it exists in 3.2a.
It has both a build-time and run-time dependency on ncurses-6.4-20230423 or later.
```