如何让 iPython 遵循终端的主题?

如何让 iPython 遵循终端的主题?

使用 Windows 终端,我在 WSL 中为 PowerShell 和 Ubuntu 20.04 设置了主题,但为什么 iPython 遵循前者的主题,而在 Linux 中却回到了某种“Breeze”?

PowerShell 上的 iPython Ubuntu WSL 上的 iPython

我确信这不是版本问题,因为当我在 Linux 上使用更新的 iPython 时我得到了类似的结果,并且还在终端上获得了“默认”主题:

Linux 上的 iPython

为什么会发生这种情况?在 Linux 环境中,如何让 iPython 遵循我的终端主题?


编辑:包括所要求的 Windows 终端配置文件。

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    // Add custom actions and keybindings to this array.
    // To unbind a key combination from your defaults.json, set the command to "unbound".
    // To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
    "actions":
    [
        // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
        // These two lines additionally bind them to Ctrl+C and Ctrl+V.
        // To learn more about selection, visit https://aka.ms/terminal-selection
        {
            "command":
            {
                "action": "copy",
                "singleLine": false
            },
            "keys": "ctrl+c"
        },
        {
            "command": "paste",
            "keys": "ctrl+v"
        },
        // Press Ctrl+Shift+F to open the search box
        {
            "command": "find",
            "keys": "ctrl+shift+f"
        },
        // Press Alt+Shift+D to open a new pane.
        // - "split": "auto" makes this pane open in the direction that provides the most surface area.
        // - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
        // To learn more about panes, visit https://aka.ms/terminal-panes
        {
            "command":
            {
                "action": "splitPane",
                "split": "auto",
                "splitMode": "duplicate"
            },
            "keys": "alt+shift+d"
        }
    ],
    "alwaysShowTabs": true,
    "copyFormatting": "none",
    "copyOnSelect": true,
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "initialCols": 150,
    "initialRows": 35,
    "profiles":
    {
        "defaults":
        {
            "fontFace": "Roboto Mono"
        },
        "list":
        [
            {
                "colorScheme": "Spacedust",
                "commandline": "powershell.exe",
                "cursorShape": "filledBox",
                "experimental.retroTerminalEffect": false,
                "fontFace": "Code New Roman",
                "fontSize": 16,
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "hidden": false,
                "name": "Windows PowerShell",
                "startingDirectory": "%USERPROFILE%",
                "useAcrylic": false
            },
            {
                "colorScheme": "AtelierSulphurpool",
                "commandline": "cmd.exe",
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "hidden": false,
                "name": "Command Prompt"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "colorScheme": "Spacedust",
                "cursorShape": "filledBox",
                "fontFace": "MesloLGS NF",
                "fontSize": 15,
                "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
                "hidden": false,
                "name": "Ubuntu-20.04",
                "source": "Windows.Terminal.Wsl",
                "startingDirectory": "%USERPROFILE%",
                "suppressApplicationTitle": true,
                "tabTitle": "Ubuntu (WSL)"
            }
        ]
    },
    "schemes":
    [
        {
            "background": "#202746",
            "black": "#202746",
            "blue": "#3D8FD1",
            "brightBlack": "#6B7394",
            "brightBlue": "#898EA4",
            "brightCyan": "#9C637A",
            "brightGreen": "#293256",
            "brightPurple": "#DFE2F1",
            "brightRed": "#C76B29",
            "brightWhite": "#F5F7FF",
            "brightYellow": "#5E6687",
            "cursorColor": "#FFFFFF",
            "cyan": "#22A2C9",
            "foreground": "#979DB4",
            "green": "#AC9739",
            "name": "AtelierSulphurpool",
            "purple": "#6679CC",
            "red": "#C94922",
            "selectionBackground": "#FFFFFF",
            "white": "#979DB4",
            "yellow": "#C08B30"
        },
        {
            "background": "#0A1E24",
            "black": "#6E5346",
            "blue": "#0F548B",
            "brightBlack": "#684C31",
            "brightBlue": "#67A0CE",
            "brightCyan": "#83A7B4",
            "brightGreen": "#AECAB8",
            "brightPurple": "#FF8A3A",
            "brightRed": "#FF8A3A",
            "brightWhite": "#FEFFF1",
            "brightYellow": "#FFC878",
            "cursorColor": "#FFFFFF",
            "cyan": "#06AFC7",
            "foreground": "#ECF0C1",
            "green": "#5CAB96",
            "name": "Spacedust",
            "purple": "#E35B00",
            "red": "#E35B00",
            "selectionBackground": "#FFFFFF",
            "white": "#F0F1CE",
            "yellow": "#E3CD7B"
        }
    ],
    "wordDelimiters": " /\\()\"'-.,:;<>~!@#$%^&*|+=[]{}~?\u2502"
}

相关内容