lingnand/VIMonad

(feature request) Support user-configured terminal emulator as xterm replacement

Closed this issue · 5 comments

I took a quick stab at this myself, but am not very proficient with Haskell, and am almost completely unfamiliar with the xmonad or XMonadContrib code-bases, or indeed, this one. My hope would be that the terminal configured in ~/.xmonad/xmonad.hs could be used everywhere xterm is currently hard-coded.

Hi torrancew,

You should start off by looking at XMonadContrib/XMonad/Vim/Constants.hs, changing myTerminal to whatever you'd like.

The next step is to modify XMonadContrib/XMonad/Vim/Term.hs, changing the functions to do the right thing for your terminal of choice. Especially, isTerm should tell VIMonad how to distinguish a window as a terminal (most of the time changing the ClassName to the appropriate one would be sufficient); isRecyclableTerm determines whether a terminal window can be reused (idle, so that M-g t would use that window instead of spawning a new one); termFullCmd should be the command string to launch the terminal (Note the launched terminal should have the name argument as its AppName set in its window properties).

If you know nothing about ClassName and AppName, install xprop and checkout WM_CLASS of each window - the first field is AppName, the second one is ClassName.

You might want to do some trial-and-error and see what works and what breaks, and then play around with changing the above mentioned functions.

Thanks, @lynnard! A couple of questions:

  • Can myTerminal be accessed freely in XMonadContrib/XMonad/Vim/Term.hs?
  • Would you be open to a pull request that bases more decisions off of myTerminal instead of assuming xterm?

If you take a closer look, Term.hs imports Constants and does make use of myTerminal. As far as I can remember, VIMonad takes advantage of myTerminal to the fullest extent it can.

I don't think any pull request can do any better than what it's already there - as I mentioned, VIMonad doesn't assume your terminal is xterm for most of its operations. However, there might be certain functionalities of xterm used by VIMonad which your terminal of choice might not support.

#6 was created based on this discussion, and would add support for urxvt (which brings some nice features like urlview-like plugins, while still being a very light UTF-8-compatible terminal emulator). If you're not interested, I understand, but I was hoping to minimize any fork management I may otherwise have to maintain with this great project!

I've merged your commit into master