Weird characters are added when I press alt-tab in vim's insert mode










1















Hello Dear Vim Lovers,



The situation is this.



I am editing something in vim. While I am in insert mode, I press alt-tab key to switch to another window. When I return back to vim, I am seeing alt and tab keys were captured by vim and inserted into my text.



It seems like [O[I[O[I[O[I[O[I.



I am working in gnome-terminal. I do not recall this behavior in my previous setups. There must be something wrong but I could not figure it out yet. In case anyone knows how to fix it, please let me know.



Thank you!










share|improve this question






















  • I'm sort of clueless, but to me the problem would have to be with your 1) OS, 2) UI (xwindows stack), or 3) gnome-terminal. One of those systems should be eating alt-tab so that it doesn't get forwarded to the app in gnome-terminal. I'm sure vim can be made to swallow alt-tab, but you'll run into other issues, I suspect. Maybe try on unix.stackexchange or askubuntu (if appropriate)?

    – zzxyz
    Nov 15 '18 at 3:30












  • @zzxyz Thank you for your input. I tried to map alt-tab in insert mode to <ESC> but it did not work. It seem it captures Alt and Tab separately.

    – Validus Oculus
    Nov 15 '18 at 3:35











  • Yeah, and I think you could probably map the escape sequence like e[0[I or whatever, but then you still probably run into problems with other shells, emacs, neovim, etc...ps...if you do sed -n l, and then hit say...ctrl-right arrow, you should see a sequence...you should not see a sequence for alt-tab. Curious if you do

    – zzxyz
    Nov 15 '18 at 3:53






  • 2





    Are you using tmux? If so, is the tmux option 'focus-events' set (look at the output of $ tmux show-options -s | grep focus)? Are you using the vim-tmux-focus-events plugin? If so, what's the output of :verb nno <f24> and :verb nno <f25>?

    – user938271
    Nov 15 '18 at 9:12












  • @user938271 Thank you for your comment. The focus-events is on. The others are set by vim-tmux-focus-events plugin. Do you know any solution for this? n <F24> * :silent doautocmd FocusLost %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim n <F25> * :doautocmd FocusGained %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim

    – Validus Oculus
    Nov 19 '18 at 5:59
















1















Hello Dear Vim Lovers,



The situation is this.



I am editing something in vim. While I am in insert mode, I press alt-tab key to switch to another window. When I return back to vim, I am seeing alt and tab keys were captured by vim and inserted into my text.



It seems like [O[I[O[I[O[I[O[I.



I am working in gnome-terminal. I do not recall this behavior in my previous setups. There must be something wrong but I could not figure it out yet. In case anyone knows how to fix it, please let me know.



Thank you!










share|improve this question






















  • I'm sort of clueless, but to me the problem would have to be with your 1) OS, 2) UI (xwindows stack), or 3) gnome-terminal. One of those systems should be eating alt-tab so that it doesn't get forwarded to the app in gnome-terminal. I'm sure vim can be made to swallow alt-tab, but you'll run into other issues, I suspect. Maybe try on unix.stackexchange or askubuntu (if appropriate)?

    – zzxyz
    Nov 15 '18 at 3:30












  • @zzxyz Thank you for your input. I tried to map alt-tab in insert mode to <ESC> but it did not work. It seem it captures Alt and Tab separately.

    – Validus Oculus
    Nov 15 '18 at 3:35











  • Yeah, and I think you could probably map the escape sequence like e[0[I or whatever, but then you still probably run into problems with other shells, emacs, neovim, etc...ps...if you do sed -n l, and then hit say...ctrl-right arrow, you should see a sequence...you should not see a sequence for alt-tab. Curious if you do

    – zzxyz
    Nov 15 '18 at 3:53






  • 2





    Are you using tmux? If so, is the tmux option 'focus-events' set (look at the output of $ tmux show-options -s | grep focus)? Are you using the vim-tmux-focus-events plugin? If so, what's the output of :verb nno <f24> and :verb nno <f25>?

    – user938271
    Nov 15 '18 at 9:12












  • @user938271 Thank you for your comment. The focus-events is on. The others are set by vim-tmux-focus-events plugin. Do you know any solution for this? n <F24> * :silent doautocmd FocusLost %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim n <F25> * :doautocmd FocusGained %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim

    – Validus Oculus
    Nov 19 '18 at 5:59














1












1








1








Hello Dear Vim Lovers,



The situation is this.



I am editing something in vim. While I am in insert mode, I press alt-tab key to switch to another window. When I return back to vim, I am seeing alt and tab keys were captured by vim and inserted into my text.



It seems like [O[I[O[I[O[I[O[I.



I am working in gnome-terminal. I do not recall this behavior in my previous setups. There must be something wrong but I could not figure it out yet. In case anyone knows how to fix it, please let me know.



Thank you!










share|improve this question














Hello Dear Vim Lovers,



The situation is this.



I am editing something in vim. While I am in insert mode, I press alt-tab key to switch to another window. When I return back to vim, I am seeing alt and tab keys were captured by vim and inserted into my text.



It seems like [O[I[O[I[O[I[O[I.



I am working in gnome-terminal. I do not recall this behavior in my previous setups. There must be something wrong but I could not figure it out yet. In case anyone knows how to fix it, please let me know.



Thank you!







vim






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '18 at 2:34









Validus OculusValidus Oculus

1,22611125




1,22611125












  • I'm sort of clueless, but to me the problem would have to be with your 1) OS, 2) UI (xwindows stack), or 3) gnome-terminal. One of those systems should be eating alt-tab so that it doesn't get forwarded to the app in gnome-terminal. I'm sure vim can be made to swallow alt-tab, but you'll run into other issues, I suspect. Maybe try on unix.stackexchange or askubuntu (if appropriate)?

    – zzxyz
    Nov 15 '18 at 3:30












  • @zzxyz Thank you for your input. I tried to map alt-tab in insert mode to <ESC> but it did not work. It seem it captures Alt and Tab separately.

    – Validus Oculus
    Nov 15 '18 at 3:35











  • Yeah, and I think you could probably map the escape sequence like e[0[I or whatever, but then you still probably run into problems with other shells, emacs, neovim, etc...ps...if you do sed -n l, and then hit say...ctrl-right arrow, you should see a sequence...you should not see a sequence for alt-tab. Curious if you do

    – zzxyz
    Nov 15 '18 at 3:53






  • 2





    Are you using tmux? If so, is the tmux option 'focus-events' set (look at the output of $ tmux show-options -s | grep focus)? Are you using the vim-tmux-focus-events plugin? If so, what's the output of :verb nno <f24> and :verb nno <f25>?

    – user938271
    Nov 15 '18 at 9:12












  • @user938271 Thank you for your comment. The focus-events is on. The others are set by vim-tmux-focus-events plugin. Do you know any solution for this? n <F24> * :silent doautocmd FocusLost %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim n <F25> * :doautocmd FocusGained %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim

    – Validus Oculus
    Nov 19 '18 at 5:59


















  • I'm sort of clueless, but to me the problem would have to be with your 1) OS, 2) UI (xwindows stack), or 3) gnome-terminal. One of those systems should be eating alt-tab so that it doesn't get forwarded to the app in gnome-terminal. I'm sure vim can be made to swallow alt-tab, but you'll run into other issues, I suspect. Maybe try on unix.stackexchange or askubuntu (if appropriate)?

    – zzxyz
    Nov 15 '18 at 3:30












  • @zzxyz Thank you for your input. I tried to map alt-tab in insert mode to <ESC> but it did not work. It seem it captures Alt and Tab separately.

    – Validus Oculus
    Nov 15 '18 at 3:35











  • Yeah, and I think you could probably map the escape sequence like e[0[I or whatever, but then you still probably run into problems with other shells, emacs, neovim, etc...ps...if you do sed -n l, and then hit say...ctrl-right arrow, you should see a sequence...you should not see a sequence for alt-tab. Curious if you do

    – zzxyz
    Nov 15 '18 at 3:53






  • 2





    Are you using tmux? If so, is the tmux option 'focus-events' set (look at the output of $ tmux show-options -s | grep focus)? Are you using the vim-tmux-focus-events plugin? If so, what's the output of :verb nno <f24> and :verb nno <f25>?

    – user938271
    Nov 15 '18 at 9:12












  • @user938271 Thank you for your comment. The focus-events is on. The others are set by vim-tmux-focus-events plugin. Do you know any solution for this? n <F24> * :silent doautocmd FocusLost %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim n <F25> * :doautocmd FocusGained %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim

    – Validus Oculus
    Nov 19 '18 at 5:59

















I'm sort of clueless, but to me the problem would have to be with your 1) OS, 2) UI (xwindows stack), or 3) gnome-terminal. One of those systems should be eating alt-tab so that it doesn't get forwarded to the app in gnome-terminal. I'm sure vim can be made to swallow alt-tab, but you'll run into other issues, I suspect. Maybe try on unix.stackexchange or askubuntu (if appropriate)?

– zzxyz
Nov 15 '18 at 3:30






I'm sort of clueless, but to me the problem would have to be with your 1) OS, 2) UI (xwindows stack), or 3) gnome-terminal. One of those systems should be eating alt-tab so that it doesn't get forwarded to the app in gnome-terminal. I'm sure vim can be made to swallow alt-tab, but you'll run into other issues, I suspect. Maybe try on unix.stackexchange or askubuntu (if appropriate)?

– zzxyz
Nov 15 '18 at 3:30














@zzxyz Thank you for your input. I tried to map alt-tab in insert mode to <ESC> but it did not work. It seem it captures Alt and Tab separately.

– Validus Oculus
Nov 15 '18 at 3:35





@zzxyz Thank you for your input. I tried to map alt-tab in insert mode to <ESC> but it did not work. It seem it captures Alt and Tab separately.

– Validus Oculus
Nov 15 '18 at 3:35













Yeah, and I think you could probably map the escape sequence like e[0[I or whatever, but then you still probably run into problems with other shells, emacs, neovim, etc...ps...if you do sed -n l, and then hit say...ctrl-right arrow, you should see a sequence...you should not see a sequence for alt-tab. Curious if you do

– zzxyz
Nov 15 '18 at 3:53





Yeah, and I think you could probably map the escape sequence like e[0[I or whatever, but then you still probably run into problems with other shells, emacs, neovim, etc...ps...if you do sed -n l, and then hit say...ctrl-right arrow, you should see a sequence...you should not see a sequence for alt-tab. Curious if you do

– zzxyz
Nov 15 '18 at 3:53




2




2





Are you using tmux? If so, is the tmux option 'focus-events' set (look at the output of $ tmux show-options -s | grep focus)? Are you using the vim-tmux-focus-events plugin? If so, what's the output of :verb nno <f24> and :verb nno <f25>?

– user938271
Nov 15 '18 at 9:12






Are you using tmux? If so, is the tmux option 'focus-events' set (look at the output of $ tmux show-options -s | grep focus)? Are you using the vim-tmux-focus-events plugin? If so, what's the output of :verb nno <f24> and :verb nno <f25>?

– user938271
Nov 15 '18 at 9:12














@user938271 Thank you for your comment. The focus-events is on. The others are set by vim-tmux-focus-events plugin. Do you know any solution for this? n <F24> * :silent doautocmd FocusLost %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim n <F25> * :doautocmd FocusGained %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim

– Validus Oculus
Nov 19 '18 at 5:59






@user938271 Thank you for your comment. The focus-events is on. The others are set by vim-tmux-focus-events plugin. Do you know any solution for this? n <F24> * :silent doautocmd FocusLost %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim n <F25> * :doautocmd FocusGained %<CR> Last set from ~/workshop/dotfiles/vim/bundle/vim-tmux-focus-events/plugin/tmux_focus_events.vim

– Validus Oculus
Nov 19 '18 at 5:59













1 Answer
1






active

oldest

votes


















1














I was running into this problem after remapping <Esc> to a noop as recommended here. Deleting the remap stopped the characters from being inserted.






share|improve this answer























  • thank you! it works on my side too :)

    – Validus Oculus
    1 hour ago










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53311607%2fweird-characters-are-added-when-i-press-alt-tab-in-vims-insert-mode%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I was running into this problem after remapping <Esc> to a noop as recommended here. Deleting the remap stopped the characters from being inserted.






share|improve this answer























  • thank you! it works on my side too :)

    – Validus Oculus
    1 hour ago















1














I was running into this problem after remapping <Esc> to a noop as recommended here. Deleting the remap stopped the characters from being inserted.






share|improve this answer























  • thank you! it works on my side too :)

    – Validus Oculus
    1 hour ago













1












1








1







I was running into this problem after remapping <Esc> to a noop as recommended here. Deleting the remap stopped the characters from being inserted.






share|improve this answer













I was running into this problem after remapping <Esc> to a noop as recommended here. Deleting the remap stopped the characters from being inserted.







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 15 at 21:19









Mason BourgeoisMason Bourgeois

765




765












  • thank you! it works on my side too :)

    – Validus Oculus
    1 hour ago

















  • thank you! it works on my side too :)

    – Validus Oculus
    1 hour ago
















thank you! it works on my side too :)

– Validus Oculus
1 hour ago





thank you! it works on my side too :)

– Validus Oculus
1 hour ago



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53311607%2fweird-characters-are-added-when-i-press-alt-tab-in-vims-insert-mode%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Barbados

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3