-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
broken pane #178
Comments
That's an interesting error. wget https://raw.githubusercontent.com/greymd/tmux-xpanes/v4.1.3/bin/xpanes
sed -i.bak '669s/$/\n sleep 0.5/' xpanes
chmod +x xpanes
./xpanes --debug -s {1..5} The above operations inserts sleep command into https://github.com/greymd/tmux-xpanes/blob/v4.1.3/bin/xpanes#L669-L670 , and execute updated There is a known issue that particular environments gets problem when processing named pipes in parallel. And the error you reported also seems to be related to named pipes. After that, could you please share the output of the following command execution? ## For macOS
sysctl kern.version
## For Linux
uname -a
/usr/bin/env bash -c 'type mkfifo'
/usr/bin/env bash --version
xpanes --version
xpanes --debug -s {1..5} Thanks, |
yep, that seems to work. below is the requested info.
|
Thank you @fawaf for providing logs. I wonder if there is a problem with the parallel processing of named pipes created by And I am very interested in the cause of this problem. If you don't mind, could you save the script below and run it in bash? #!/bin/bash
set -eu
## Create temporary directory
tmpdir=$(mktemp -d)
## Clean directory on exit
trap 'rm -rf $tmpdir' EXIT
## function to read from a pipe
readpipe() {
grep . "$1" &
}
{
cd "$tmpdir"
# 1. Create a named pipe x 50 in the temporary directory (pipe.1 .. pipe.50)
for i in {1..50}
do
mkfifo pipe."$i"
done
# 2. Create 50 threads to read from each pipe
for i in {1..50}
do
readpipe pipe."$i"
done
# 3. Input a number from 1 to 50 into each pipe asynchronusly
for i in {1..50}
do
printf "finish:$i" > pipe."$i" &
done
# 4. Each thread will read the number from the pipe and print it to the screen
wait
} In my environment, it successfully processes 50 named pipes as shown below. What about your environment? $ bash mkfifos.sh
finish:1
finish:2
finish:3
finish:4
finish:5
finish:7
finish:6
finish:10
finish:9
finish:12
finish:18
finish:14
finish:13
finish:16
finish:15
finish:8
finish:17
finish:11
finish:19
finish:24
finish:22
finish:20
finish:23
finish:25
finish:21
finish:27
finish:29
finish:26
finish:30
finish:34
finish:31
finish:28
finish:38
finish:33
finish:44
finish:35
finish:47
finish:42
finish:32
finish:37
finish:39
finish:36
finish:40
finish:41
finish:43
finish:46
finish:49
finish:48
finish:45
finish:50 |
The latest version, v4.1.4, the feature alias xpanes='xpanes --interval 0.2' Please make use of this. |
output as requested. looks fine to me i think?
|
submitted Homebrew/homebrew-core#125557 as well |
Yes, it looks it works normally.
Thank you so much 😃 Can you try to reproduce the issue when you get to use v4.1.4? |
just tested out the new version and the issue still exists with v4.1.4 (without |
hmm.... the issue disappears after running |
Oh, that's weird. Ok, if the issue reproduced next time, can you collect logs by following way?
diff --git a/xpanes b/xpanes
index d503b90..e2ecb08 100755
--- a/xpanes
+++ b/xpanes
@@ -47,7 +47,7 @@ readonly XP_ENOCMD=127
# XP_THIS_FILE_NAME is supposed to be "xpanes".
readonly XP_THIS_FILE_NAME="${0##*/}"
readonly XP_THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
-readonly XP_ABS_THIS_FILE_NAME="${XP_THIS_DIR}/${XP_THIS_FILE_NAME}"
+readonly XP_ABS_THIS_FILE_NAME="bash -x ${XP_THIS_DIR}/${XP_THIS_FILE_NAME}"
# Prevent cache directory being created under root / directory in any case.
# This is quite rare case (but it can be happened).
@@ -1516,7 +1516,7 @@ xpns_pre_execution() {
${TMUX_XPANES_EXEC} -S "${XP_SOCKET_PATH}" new-session \
-s "${XP_SESSION_NAME}" \
-n "${XP_TMP_WIN_NAME}" \
- -d "${XP_ABS_THIS_FILE_NAME} ${_opts4args} ${_args4args}"
+ -d "${XP_ABS_THIS_FILE_NAME} ${_opts4args} ${_args4args} &> debug.log"
# Avoid attaching (for unit testing).
if [[ ${XP_OPT_ATTACH} -eq 1 ]]; then
$ wget https://raw.githubusercontent.com/greymd/tmux-xpanes/v4.1.4/bin/xpanes
$ patch < xpanes.patch
### Reproduce the issue
$ bash -x ./xpanes -s {1..5} 2> start-debug.log
|
cool, happened just now. attached log file as requested. oddly, i don't see the debug.log file though and only the start-debug file. |
btw, i think i totally forgot to mention that i'm running xpanes in an existing tmux session. |
if i specify 1 or more panes to do work in (e.g.
echo 1 2 3
), xpanes will have a blank pane that doesn't show anything and does not respond to input. not sure if it is a misconfiguration on my side, or a tmux issue.see screen capture below for an example of this happening
https://user-images.githubusercontent.com/639565/221677162-56a3dff5-33d2-4a11-8004-ef32664c47ba.mov
The text was updated successfully, but these errors were encountered: