Use pane_id instead of pane_index to identify a pane since the latter
can change after a pane was created.