Fixed incorrect terminal splitting.

When there was multiple active sessions.