I have a recurring problem with the Mac terminal.

  1. Start terminal
  2. mysql
  3. Ctrl + Z
  4. mysql
  5. Resize the width of the window
  6. Ctrl + Z
  7. fg 1 (switch back to first mysql)
  8. Type some text that reaches the end of the line

PROBLEM: Mysql seems to still think the window has the original width, so when the text you type reaches the right hand side of the terminal window, the text starts jumping around like crazy as you type, because it is not repositioned correctly.

WORKAROUND: If I change the size of the window just one character, the problem is solved, but it is annoying having to do this several times per day.

I thought of possible things that could be wrong:

  • Bug in MySQL/MariaDB
  • Bug in Terminal
  • Wrong Terminal settings
  • Wrong Bash settings

Anyone have a solution to the problem, or know who is most likely the culprit, so I know where to direct a bug report?

  • 2
    It's not a bug, it's how Unix signaling works. May I propose to run the different MySQL sessions in individual tabs or to resize the window before step 2?
    – nohillside
    Commented Jun 28, 2013 at 15:55

1 Answer 1


I think this happens because the window resize signals are sent while the app is suspended, so it won't receive them. One way to fix it may be to manually send the SIGWINCH signal to the process while it is in the foreground. From another terminal, run:

killall -WINCH mysql
  • Yes, the killall solves the problem. But the end user can't be expected having to do this manually all the time. Does a fix belong in Terminal, MySQL or elsewhere?
    – forthrin
    Commented Jun 28, 2013 at 21:18
  • It's not so much of a bug as an unfortunate side effect of suspended processes not being able to react to the signals. If you want to fix this, I'm guessing the most correct way would be to add a command or keyboard shortcut to mysql to re-query the screen size, so it can do whatever it needs to update readline's idea of the screen size?
    – faffaffaff
    Commented Jun 28, 2013 at 21:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .