Search code examples
vimgnome-terminalawesome-wm

running a Program from vim that opens another window messes up the formating of my terminal


Im using vim inside a gnome-Terminal to edit a Python Program. Im also using a tiling Window manager calles awesome-wm.

Inside my Python program im plotting some data to a matplotlib graph (when executed that opens another window). When i want to test my Program i use the following comand to run the Program from inside of vim.

:!python3 %

enter image description here

when the Program runs it prints three messages to the shell and opens a matplotlib window to plot the data.

enter image description here

Sometimes i can only see the messed up linebreaks and have to scroll up to see the messages. My question now is why is the formating inside the console messed up an how do i fix it?

My guess would be that the Terminal Window does not notice that it is beeing resized when the plot window is beeing opend, but i dont know how to refresh the terminal in that case. using :!clear; python3 % does not help.

Thanks in advance.


Solution

  • (Well, it isn't a direct solution to your problem, but here it goes.)

    Most terminal don't handle reflow in resize properly. There is no right ways to do it so most don't attempt to pull all the tricks in the book to make this better. After all, for classic floating window manger, resizing isn't something you do very often. LibVTE/Gnome-terminal isn't designed for tiling WMs and has not been patched over the years to make it better.

    Urxvt is probably the most common terminal for AwesomeWM (the default is xterm because it is much more commonly installed by default). It has more advanced features like tabs and transparency you expect from modern terminals. Note that some of them (tabs) are disabled by default.

    Sometime using software like tmux can be used to mitigate some of the limitations of any given terminal, but it comes with limitations of its own.