ardagnir / pterosaur

All firefox text fields are vim.
GNU Affero General Public License v3.0
772 stars 30 forks source link

Pterosaur does not work with X11 Forwarding #37

Closed nihlaeth closed 9 years ago

nihlaeth commented 9 years ago

When I enable pterosaur, I can't type in textfields.

My system:

Slackware 14.0 Firefox 36 Vim 7.4 (+clientserver) - vundle/vimbed installed & working Gvim 7.3 (+clientserver) Pentadactyl 1.2 Pterosaur 1.0.4

I did use the pterosaur version provided in the mozilla repo, but when that didn't work I installed the latest version from git, no difference.

vim --clientlist comes up empty (same with gvim when I put that down as editor binary).

In the browser console, I get this error:

X11 connection rejected because of wrong authentication.

I run my browser over ssh with X11 forwarding, and my guess is that doesn't play nice with pterosaur. Is there anything I can do to fix this?

ardagnir commented 9 years ago

Pterosaur uses firefox's env variables for vim. But since firefox is running on the same computer as vim, the env variables used for forwarding probably don't make sense for it.

I'll see if I can add support for forwarding eventually, but until then, the easiest thing you can do to fix this is to hardcode sane env variables (or at least XAUTHORITY) in content/pterosaur.js around line 1601.

nihlaeth commented 9 years ago

Thanks for the help, I got it to work now. The downside to this is that my browser always has to be the first xforwarding process I start or the DISPLAY value will be wrong, but I can live with that. In case anyone wants to repeat what I did:

diff --git a/content/pterosaur.js b/content/pterosaur.js index 6e43ab1..10f1da9 100644 --- a/content/pterosaur.js +++ b/content/pterosaur.js @@ -1648,6 +1648,8 @@ function startVimbed() { for (var index = 0, len = env_variables.length; index < len; index++){ env_variables[index] = env_variables[index] + "=" + Environment.get(env_variables[index]); }

ardagnir commented 9 years ago

Pterosaur 1.1 now has an envoverrides about:config option which can be used to change env variables instead of hardcoding.