      translators, especially those trying to translate to right-to-left
 ***************
 *** 827,832 ****
---- 830,842 ----
+--- 831,845 ----
   }
   
   
 + static void closeNesting()
 + {
-+   while (logNesting--)
++   while (logNestingStdout--)
 +     printf("\e[q");
++   while (logNestingStderr--)
++     fprintf(stderr, "\e[q");
 + }
 + 
 + 

  
***************
*** 2782,2787 ****
--- 2794,2805 ----
  
    /* Use entire sentences to give the translators a fighting chance.  */
  
+   if (entering)
+     {
+       printf("\e[p");
+       logNesting++;
+     }
+   
    if (makelevel == 0)

  main (argc, argv, envp)
***************
*** 854,859 ****
--- 867,874 ----
    no_default_sh_exe = 1;
  #endif
  
