# GUI/Terminal Emacs behave differently - same config

**URL:** <https://forum.systemcrafters.net/t/gui-terminal-emacs-behave-differently-same-config/885>\
**Category:** Emacs\
**Created:** [July 27, 2024, 7:50pm UTC](https://forum.systemcrafters.net/t/gui-terminal-emacs-behave-differently-same-config/885 "2024-07-27T19:50:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Splendorous\_Triangle](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Splendorous\_Triangle](https://forum.systemcrafters.net/u/Splendorous_Triangle)\
**Post date:** [July 27, 2024, 7:50pm UTC](https://forum.systemcrafters.net/t/gui-terminal-emacs-behave-differently-same-config/885/1 "2024-07-27T19:50:21Z")

</div>

Up until now I’ve primarily been using terminal emacs because much of my initial use case was remote command-line editing over a slow connection.

I’d like to use GUI emacs but I’ve discovered it behaves differently than my terminal emacs despite sharing the same `init.el`.

The most immediate difference when I invoke find file with `C-c C-f` the `<tab>` key literally inserts a tab into the minibuffer instead of incremental completion of the file path.

GUI - `<TAB>`:

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/systemcrafters/original/1X/95064fd24848547cb8c93057ee496e81075bce44.png)  
Note: Please ignore the `[s-w is undefine]` this is just a by-product of me trying to get the screen grab at the correct instant to show the point’s position.

Terminal `<TAB>` (actually double tab to pop the vertical list):  
 ![image](https://canada1.discourse-cdn.com/flex029/uploads/systemcrafters/original/1X/8dc278241999fcb2936ea68a1ab57f531f7ff6fe.png)

It seems to want `<RET>` for completions but not incremental ones, it proceeds immediately to executing the nearest match.

It is totally non-obvious to me why the GUI and terminal emacs behave differently like this or how to go about determining the culprit.

I’m not explicitly setting any mini-buffer modes or completion frameworks or even a key for mini-buffer completion in my `init.el`.

---

<div class="post-metadata">

**Author:** ![ashraz](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/ashraz/32/509_2.png) [@ashraz](https://forum.systemcrafters.net/u/ashraz)\
**Post date:** [July 28, 2024, 9:34am UTC](https://forum.systemcrafters.net/t/gui-terminal-emacs-behave-differently-same-config/885/2 "2024-07-28T09:34:45Z")

</div>

As with your last post ([Org-capture error's MSWindows](https://forum.systemcrafters.net/t/org-capture-errors-mswindows/848)) it’s hard to tell what is happening without a complete, self-contained `init.el`. Also, last time you posted you used Emacs on Windows, but this seems like a Linux distribution.

Please post a `init.el` that reproduces the issue, and try to make it as minimal as possible (e.g. remove as much as you can, especially third-party packages), otherwise it will be hard to check why that happens.

(For completeness, I took your last posted `init.el` and was not able to reproduce the issue - but then again, I could not properly load your `init.el` because it does not work without lots of interaction)

---

<div class="post-metadata">

**Author:** ![Splendorous\_Triangle](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Splendorous\_Triangle](https://forum.systemcrafters.net/u/Splendorous_Triangle)\
**Post date:** [July 30, 2024, 2:50pm UTC](https://forum.systemcrafters.net/t/gui-terminal-emacs-behave-differently-same-config/885/3 "2024-07-30T14:50:52Z")

</div>

Ahhh, I apologize. I was in a rush writing the post and thought I left this a draft but I guess I posted it 😬

You are correct that the system I am referring to here is a Linux system. The other system I have posted about previously is for work and thus MSWindows.

I have actually taken your advice from that previous thread and refactored both systems to `use-package`.

Now! In the process of trimming down my `init.el` to post it to this thread I found the culprit:

I was doing this - overriding the global key map for `<tab>`

```lisp
(use-package company                               
  :hook ((prog-mode text-mode) . company-mode)     
  :bind ("<tab>" . company-indent-or-complete-common)
  :config                                          
  (setq company-idle-delay 0)                      
  (setq company-minimum-prefix-length 1)           
  (setq company-selection-wrap-around t)           
  )                                                

```

This fixes it - remapping `<tab>` into company’s local map.

```lisp
(use-package company                               
  :hook ((prog-mode text-mode) . company-mode)     
  :bind                                            
    (:map company-active-map                       
    ("<tab>" . company-indent-or-complete-common))
  :config                                          
  (setq company-idle-delay 0)                      
  (setq company-minimum-prefix-length 1)           
  (setq company-selection-wrap-around t)           
  )                                                

```

Before I refactored to `use-package` I was doing this:

```lisp
(require 'company)
    (add-hook 'after-init-hook 'global-company-mode)
    (global-set-key (kbd "<tab>") #'company-indent-or-complete-common)
    (with-eval-after-load 'company
        (define-key company-active-map (kbd "M-/") #'company-complete))

```

Which I believe is doing more or less the same thing.  
I’m not totally clear why this results in a difference between GUI/Terminal but it was the only things that I commented out that made a difference.
