Session IDs have an offset by 1 issue for newly created panes in latest ITerm2
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: Build 3.0.9
- OS version: MacOS Sierra 10.12
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window) com.googlecode.iterm2.plist
- Attach a debug log, if possible. Instructions at https://iterm2.com/debuglog
- Are you reporting a performance issue or a hang? Please attach a sample. Instructions at https://gitlab.com/gnachman/iterm2/wikis/HowToSample Neither, featrure regression
- Are you reporting a crash? Please attach the crash log. Instructions at https://gitlab.com/gnachman/iterm2/wikis/crash-logs No
Detailed steps to reproduce the problem:
- Create a new pane echo $ITERM_SESSION_ID (it will of the form w0t0p-)
- Kill and restart iterm2, the same pane will have $ITERM_SESSION_ID w0t0p-
- The latter is the consistent numbering in my prior iterm2 versions, where pane counting started from p0, there is an offset-by-1 bug for newly created panes it seems
What happened:
I explained in #3 (closed) above. I saw this issue after moving to iterm2 latest, and as i use session IDs to track individual terminal pane histories that persist across restarts. Anytime I create a new pane, I noticed the wXtYpZ format had Z value one more than i expected. For example, consider this case, where I have a third pane just created (i.e., CTRL-D on the current tab); i see:
/Users/canturk$ echo $ITERM_SESSION_ID
w0t4p3:D20A0E9E-66D2-492E-88F1-8D949BB35FF4
Now let us kill (CTRL-Q) and restart iterm2; the same command on the same pane now returns:
/Users/canturk$ echo $ITERM_SESSION_ID
w0t4p2:FEB11DEB-C650-4992-8B11-C169EECE6543
as can be seen, the numbering changed from w0t4p3 ro w0t4p2
This latter one is consistent with prior behavior, which is what should the session ID be for a newly created pane.