#16164·jupyterlab

Pressing tab doesnt insert tabs, shows autocomplete instead.

Author: ahead-engineerCreated Apr 15, 2024Updated Sep 8, 2026
Labelsbughelp wanted

Description

Is it possible to prevent the [tab] key from doing autocomplete/suggestions in notebook, and instead add a tab, as expected?

I tried adding "disabled" : true to various entries in the shortcuts.jupyterlab-settings file, but it doesn’t seem to have any effect until using a beta as suggested in the discourse link below.

Code completion is not enabled, (default) in the jupyterlab settings window, so I’m not even sure what is firing the dropdown tooltips.

This is not a question of line indentation, which works. I want the ability to tab the = signs on successive lines so that they line up - with tabs, not spaces.

First two lines are tabbed as desired by copy-pasting tab characters, so tabs are possible, but pressing tab on the next line shows this annoying dropdown instead.

image

With the beta and json disabling tabs using json below, the behaviour changes to: pressing tab activates the notebook's tab in the tab status bar image

json
        {
            "command": "completer:invoke-console",
            "selector": ".jp-CodeConsole-promptCell .jp-mod-completer-enabled",
            "keys": [
                "Tab"
            ],
            "disabled": true
        },
        {
            "command": "completer:invoke-notebook",
            "selector": ".jp-Notebook.jp-mod-editMode .jp-mod-completer-enabled",
            "keys": [
                "Tab"
            ],
            "disabled": true
        },
        {
            "command": "completer:invoke-file",
            "selector": ".jp-FileEditor .jp-mod-completer-enabled",
            "keys": [
                "Tab"
            ],
            "disabled": true
        }

Reproduce

Open a notebook, in a code block type a word, space, then tab.

Expected behavior

\t tab character is inserted

Context

https://discourse.jupyter.org/t/make-tab-key-insert-tabs/25182

  • Operating System and version: Fedora
  • Browser and version: Brave (Chromium) 1.64.122
  • JupyterLab version: Version 4.2.0b1
Troubleshoot Output
bash
jupyter troubleshoot
$PATH:
        /home/driver/miniconda3/envs/cling/bin
        /home/driver/miniconda3/condabin
        /usr/lib64/ccache
        /usr/local/bin
        /usr/bin
        /bin
        /usr/local/sbin
        /usr/sbin
        /sbin
        /home/driver/.local/bin
        /home/driver/.local/bin
        /home/driver/.local/binsys.path:
        /home/driver/miniconda3/envs/cling/bin
        /home/driver/miniconda3/envs/cling/lib/python312.zip
        /home/driver/miniconda3/envs/cling/lib/python3.12
        /home/driver/miniconda3/envs/cling/lib/python3.12/lib-dynload
        /home/driver/.local/lib/python3.12/site-packages
        /home/driver/miniconda3/envs/cling/lib/python3.12/site-packages
sys.executable:
        /home/driver/miniconda3/envs/cling/bin/python
sys.version:
        3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:50:58) [GCC 12.3.0]
platform.platform():
        Linux-6.8.4-200.fc39.x86_64-x86_64-with-glibc2.38
which -a jupyter:
        /home/driver/miniconda3/envs/cling/bin/jupyter
pip list:
        Package                   Version
        ------------------------- ------------
        anyio                     4.2.0
        argon2-cffi               21.3.0
        argon2-cffi-bindings      21.2.0
        asttokens                 2.0.5
        async-lru                 2.0.4
        attrs                     23.1.0
        Babel                     2.11.0
        beautifulsoup4            4.12.2
        bleach                    4.1.0
        blinker                   1.7.0
        Brotli                    1.0.9
        certifi                   2024.2.2
        cffi                      1.16.0
        charset-normalizer        2.0.4
        comm                      0.2.1
        contourpy                 1.2.1
        cycler                    0.12.1
        debugpy                   1.6.7
        decorator                 5.1.1
        defusedxml                0.7.1
        dnspython                 2.6.1
        executing                 0.8.3
        fastjsonschema            2.16.2
        Flask                     3.0.3
        fonttools                 4.51.0
        h11                       0.14.0
        h2                        4.1.0
        hpack                     4.0.0
        httpcore                  1.0.5
        httpx                     0.27.0
        hyperframe                6.0.1
        idna                      3.4
        importlib_metadata        7.1.0
        importlib_resources       6.4.0
        ipykernel                 6.28.0
        ipython                   8.20.0
        ipywidgets                8.1.2
        itsdangerous              2.1.2
        jedi                      0.18.1
        Jinja2                    3.1.3
        json5                     0.9.6
        jsonschema                4.19.2
        jsonschema-specifications 2023.7.1
        jupyter                   1.0.0
        jupyter_client            8.6.0
        jupyter-console           6.6.3
        jupyter_core              5.5.0
        jupyter-events            0.8.0
        jupyter-lsp               2.2.0
        jupyter_server            2.10.0
        jupyter_server_terminals  0.4.4
        jupyterlab                4.2.0b1
        jupyterlab-pygments       0.1.2
        jupyterlab_server         2.25.1
        jupyterlab-widgets        3.0.10
        kiwisolver                1.4.5
        MarkupSafe                2.1.5
        matplotlib                3.8.4
        matplotlib-inline         0.1.6
        mistune                   2.0.4
        nbclient                  0.8.0
        nbconvert                 7.10.0
        nbformat                  5.9.2
        nest-asyncio              1.6.0
        notebook                  7.1.2
        notebook_shim             0.2.3
        overrides                 7.4.0
        packaging                 23.2
        pandocfilters             1.5.0
        parso                     0.8.3
        pexpect                   4.8.0
        pillow                    10.3.0
        pip                       23.3.1
        platformdirs              3.10.0
        plotly                    5.20.0
        ply                       3.11
        prometheus-client         0.14.1
        prompt-toolkit            3.0.43
        psutil                    5.9.0
        ptyprocess                0.7.0
        pure-eval                 0.2.2
        pycparser                 2.21
        Pygments                  2.15.1
        pymongo                   4.6.3
        pyparsing                 3.1.2
        PyQt5                     5.15.10
        PyQt5-sip                 12.13.0
        PySocks                   1.7.1
        python-dateutil           2.8.2
        python-json-logger        2.0.7
        pytz                      2023.3.post1
        PyYAML                    6.0.1
        pyzmq                     25.1.2
        qtconsole                 5.5.1
        QtPy                      2.4.1
        referencing               0.30.2
        requests                  2.31.0
        rfc3339-validator         0.1.4
        rfc3986-validator         0.1.1
        rpds-py                   0.10.6
        scipy                     1.13.0
        Send2Trash                1.8.2
        setuptools                68.2.2
        sip                       6.7.12
        six                       1.16.0
        sniffio                   1.3.0
        soupsieve                 2.5
        stack-data                0.2.0
        tenacity                  8.2.3
        terminado                 0.17.1
        tinycss2                  1.2.1
        tomli                     2.0.1
        tornado                   6.3.3
        traitlets                 5.7.1
        typing_extensions         4.9.0
        urllib3                   2.1.0
        wcwidth                   0.2.5
        webencodings              0.5.1
        websocket-client          0.58.0
        Werkzeug                  3.0.2
        wheel                     0.41.2
        widgetsnbextension        4.0.10
        zipp                      3.17.0
conda list:
        # packages in environment at /home/driver/miniconda3/envs/cling:
        #
        # Name                    Version                   Build  Channel
        _libgcc_mutex             0.1                 conda_forge    conda-forge
        _openmp_mutex             4.5                       2_gnu    conda-forge
        alsa-lib                  1.2.11               hd590300_1    conda-forge
        anyio                     4.2.0           py312h06a4308_0        argon2-cffi               21.3.0             pyhd3eb1b0_0        argon2-cffi-bindings      21.2.0          py312h5eee18b_0        asttokens                 2.0.5              pyhd3eb1b0_0        async-lru                 2.0.4           py312h06a4308_0        attr                      2.5.1                h166bdaf_1    conda-forge
        attrs                     23.1.0          py312h06a4308_0        babel                     2.11.0          py312h06a4308_0        beautifulsoup4            4.12.2          py312h06a4308_0        binutils_impl_linux-64    2.39                 he00db2b_1    conda-forge
        binutils_linux-64         2.39                h5fc0e48_13    conda-forge
        bleach                    4.1.0              pyhd3eb1b0_0        brotli-python             1.0.9           py312h6a678d5_7        bzip2                     1.0.8                h5eee18b_5        ca-certificates           2024.3.11            h06a4308_0        cairo                     1.18.0               h3faef2a_0    conda-forge
        certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
        cffi                      1.16.0          py312h5eee18b_0        charset-normalizer        2.0.4              pyhd3eb1b0_0        clang                     9.0.1           cling_v0.9_hf01e6bc_5    conda-forge
        clang-9                   9.0.1           cling_v0.9_h6699504_5    conda-forge
        clang-tools               9.0.1           cling_v0.9_h1e27157_5    conda-forge
        clangdev                  9.0.1           cling_v0.9_h1e27157_5    conda-forge
        clangxx                   9.0.1           cling_v0.9_he14baed_5    conda-forge
        cling                     0.9                  he0ac6c6_1    conda-forge
        comm                      0.2.1           py312h06a4308_0        cppzmq                    4.10.0               h2e2a08d_1    conda-forge
        dbus                      1.13.18              hb2f20db_0        debugpy                   1.6.7           py312h6a678d5_0        decorator                 5.1.1              pyhd3eb1b0_0        defusedxml                0.7.1              pyhd3eb1b0_0        executing                 0.8.3              pyhd3eb1b0_0        expat                     2.6.2                h59595ed_0    conda-forge
        font-ttf-dejavu-sans-mono 2.37                 hd3eb1b0_0        font-ttf-inconsolata      2.001                hcb22688_0        font-ttf-source-code-pro  2.030                hd3eb1b0_0        font-ttf-ubuntu           0.83                 h8b1ccd4_0        fontconfig                2.14.2               h14ed4e7_0    conda-forge
        fonts-anaconda            1                    h8fa9717_0        fonts-conda-ecosystem     1                    hd3eb1b0_0        freetype                  2.12.1               h4a9f257_0        gcc_impl_linux-64         10.4.0              h5231bdf_19    conda-forge
        gcc_linux-64              10.4.0              h9215b83_13    conda-forge
        gettext                   0.22.5               h59595ed_2    conda-forge
        gettext-tools             0.22.5               h59595ed_2    conda-forge
        glib                      2.80.0               hf2295e7_4    conda-forge
        glib-tools                2.80.0               hde27a5a_4    conda-forge
        graphite2                 1.3.14               h295c915_1        gst-plugins-base          1.24.1               hfa15dee_1    conda-forge
        gstreamer                 1.24.1               h98fc4e7_1    conda-forge
        gxx_impl_linux-64         10.4.0              h5231bdf_19    conda-forge
        gxx_linux-64              10.4.0              h6e491c6_13    conda-forge
        h11                       0.14.0             pyhd8ed1ab_0    conda-forge
        h2                        4.1.0              pyhd8ed1ab_0    conda-forge
        harfbuzz                  8.3.0                h3d44ed6_0    conda-forge
        hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
        httpcore                  1.0.5              pyhd8ed1ab_0    conda-forge
        httpx                     0.27.0             pyhd8ed1ab_0    conda-forge
        hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
        icu                       73.2                 h59595ed_0    conda-forge
        idna                      3.4             py312h06a4308_0        importlib-metadata        7.1.0              pyha770c72_0    conda-forge
        importlib_metadata        7.1.0                hd8ed1ab_0    conda-forge
        importlib_resources       6.4.0              pyhd8ed1ab_0    conda-forge
        ipykernel                 6.28.0          py312h06a4308_0        ipython                   8.20.0          py312h06a4308_0        ipywidgets                8.1.2           py312h06a4308_0        jedi                      0.18.1          py312h06a4308_1        jinja2                    3.1.3           py312h06a4308_0        json5                     0.9.6              pyhd3eb1b0_0        jsonschema                4.19.2          py312h06a4308_0        jsonschema-specifications 2023.7.1        py312h06a4308_0        jupyter                   1.0.0           py312h06a4308_9        jupyter-lsp               2.2.0           py312h06a4308_0        jupyter_client            8.6.0           py312h06a4308_0        jupyter_console           6.6.3           py312h06a4308_1        jupyter_core              5.5.0           py312h06a4308_0        jupyter_events            0.8.0           py312h06a4308_0        jupyter_server            2.10.0          py312h06a4308_0        jupyter_server_terminals  0.4.4           py312h06a4308_1        jupyterlab                4.2.0b1            pyh62ca5b2_0    conda-forge/label/jupyterlab_beta
        jupyterlab_pygments       0.1.2                      py_0        jupyterlab_server         2.25.1          py312h06a4308_0        jupyterlab_widgets        3.0.10          py312h06a4308_0        kernel-headers_linux-64   2.6.32              he073ed8_17    conda-forge
        keyutils                  1.6.1                h166bdaf_0    conda-forge
        krb5                      1.21.2               h659d440_0    conda-forge
        lame                      3.100                h7b6447c_0        ld_impl_linux-64          2.39                 hcc3a1bd_1    conda-forge
        libasprintf               0.22.5               h661eb56_2    conda-forge
        libasprintf-devel         0.22.5               h661eb56_2    conda-forge
        libcap                    2.69                 h0f662aa_0    conda-forge
        libclang                  9.0.1           cling_v0.9_h1e27157_5    conda-forge
        libclang-cpp              9.0.1           cling_v0.9_h6699504_5    conda-forge
        libclang-cpp15            15.0.7          default_h127d8a8_5    conda-forge
        libclang-cpp9             9.0.1           cling_v0.9_h6699504_5    conda-forge
        libclang13                18.1.3          default_h5d6823c_0    conda-forge
        libcups                   2.3.3                h4637d8d_4    conda-forge
        libedit                   3.1.20230828         h5eee18b_0        libevent                  2.1.12               hdbd6064_1        libexpat                  2.6.2                h59595ed_0    conda-forge
        libffi                    3.4.4                h6a678d5_0        libflac                   1.4.3                h59595ed_0    conda-forge
        libgcc-devel_linux-64     10.4.0              hd38fd1e_19    conda-forge
        libgcc-ng                 13.2.0               h807b86a_5    conda-forge
        libgcrypt                 1.10.3               hd590300_0    conda-forge
        libgettextpo              0.22.5               h59595ed_2    conda-forge
        libgettextpo-devel        0.22.5               h59595ed_2    conda-forge
        libglib                   2.80.0               hf2295e7_4    conda-forge
        libgomp                   13.2.0               h807b86a_5    conda-forge
        libgpg-error              1.48                 h71f35ed_0    conda-forge
        libiconv                  1.17                 hd590300_2    conda-forge
        libjpeg-turbo             3.0.0                hd590300_1    conda-forge
        libllvm15                 15.0.7               hb3ce162_4    conda-forge
        libllvm18                 18.1.3               h2448989_0    conda-forge
        libllvm9                  9.0.1           default_hc23dcda_7    conda-forge
        libnsl                    2.0.1                hd590300_0    conda-forge
        libogg                    1.3.5                h27cfd23_1        libopus                   1.3.1                h7b6447c_0        libpng                    1.6.43               h2797004_0    conda-forge
        libpq                     16.2                 h33b98f1_1    conda-forge
        libsanitizer              10.4.0              h5246dfb_19    conda-forge
        libsndfile                1.2.2                hc60ed4a_1    conda-forge
        libsodium                 1.0.18               h36c2ea0_1    conda-forge
        libsqlite                 3.45.2               h2797004_0    conda-forge
        libstdcxx-devel_linux-64  10.4.0              hd38fd1e_19    conda-forge
        libstdcxx-ng              13.2.0               h7e041cc_5    conda-forge
        libsystemd0               255                  h3516f8a_1    conda-forge
        libuuid                   2.38.1               h0b41bf4_0    conda-forge
        libvorbis                 1.3.7                h7b6447c_0        libxcb                    1.15                 h7f8727e_0        libxcrypt                 4.4.36               hd590300_1    conda-forge
        libxkbcommon              1.7.0                h662e7e4_0    conda-forge
        libxml2                   2.12.6               h232c23b_1    conda-forge
        libzlib                   1.2.13               hd590300_5    conda-forge
        llvm-tools                9.0.1           cling_v0.9_h2b820e9_7    conda-forge
        llvmdev                   9.0.1           cling_v0.9_h2b820e9_7    conda-forge
        lz4-c                     1.9.4                h6a678d5_0        markupsafe                2.1.3           py312h5eee18b_0        matplotlib-inline         0.1.6           py312h06a4308_0        mistune                   2.0.4           py312h06a4308_0        mpg12