zed icon indicating copy to clipboard operation
zed copied to clipboard

Zed window should remember last window size and position

Open ksandvik opened this issue 3 years ago • 45 comments

Check for existing issues

  • [X] Completed

Describe the bug

When opening Zed it should remember previous window size and position when Zed was closed.

To reproduce

  1. Open Zed, set expected window size and position.
  2. Close Zed.
  3. Open Zed again.

Expected behavior

Expected: previous window size/position is honored. Now: Using same size and location at startup.

Environment

Zed 0.49.1 – /Applications/Zed.app \nmacOS 12.5 \narchitecture x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue

No response

ksandvik avatar Aug 01 '22 20:08 ksandvik

Blocks on: https://github.com/zed-industries/feedback/issues/430

mikayla-maki avatar Aug 08 '22 16:08 mikayla-maki

+1 — this is going to sound ridiculous, but it's a blocker for adaptation for me as I open a lot of temporary windows in my workflow (currently using Sublime.)

rsms avatar Aug 09 '22 16:08 rsms

+1 — this is going to sound ridiculous, but it's a blocker for adaptation for me as I open a lot of temporary windows in my workflow (currently using Sublime.)

I don't think it is ridiculous, it is a pain to reset everything up every time.

iamnbutler avatar Aug 09 '22 17:08 iamnbutler

This and a "recent" file menu (#77) is adding unnecessary friction to getting started with my work. Hard to measure the pain threshold, but its in the back of my mind every time I open Zed.

jbergstroem avatar Oct 21 '22 13:10 jbergstroem

An option to "reopen where left off" (last project and files open from before last close) would also be lovely!

benonymus avatar Nov 01 '22 11:11 benonymus

This was the first thing I noticed when I launched the app. I'm glad to see other people care. The mention of serializable workspaces (#430) makes me worry about it being tied to saving a workspace. I basically only care about the default new window size which I would think would be tied to a new (unsaved) workspace.

emlynmu avatar Nov 17 '22 02:11 emlynmu

I just came here to say the exact same thing as @emlynmu – this should be separate behavior from serializing workspaces. On macOS, whenever you open a new window of an existing (well-behaved) application, it matches the size of the most recent[^ish] window. It should also open in a new position, offset down-and-to-the-right (with "wrapping" that respects positions of existing windows) behavior.

Here's how it looks with VS Code (it took them years to get to it, but they finally did 😂):

https://user-images.githubusercontent.com/2403023/202511452-ad570e9c-535e-494e-92f1-6d318778c40c.mp4

[^ish]: ish, there are subtleties; it's something like "most recent window which actually had focus" or "root window" when you have a hierarchy of windows etc.

chriskrycho avatar Nov 17 '22 17:11 chriskrycho

Thanks for the behavioral explanation @chriskrycho! :D

mikayla-maki avatar Nov 17 '22 17:11 mikayla-maki

This should go out with v0.72.0.

JosephTLyons avatar Feb 06 '23 20:02 JosephTLyons

I regret to say: This is not quite fixed in 0.72.x, though it took a big step forward: It is fixed when saving workspaces, and appears to remember the position used for a specific folder, but the feature request here is for a muuuuuch more general feature! See e.g. my example above—and note as well that you can trivially reproduce this by just opening any folder and then opening any new window!

chriskrycho avatar Feb 09 '23 04:02 chriskrycho

If I close Zed while fullscreen it still won't start in fullscreen mode. It would improve consistency if it would remember the mode across restarts.

stjepangolemac avatar Jun 15 '23 07:06 stjepangolemac

Bump, cc @JosephTLyons

stjepangolemac avatar Jan 17 '24 08:01 stjepangolemac

I think it would be ideal if the new editor window had the dimensions of the recently opened project window. Don't like it when a 'clean' window takes up the entire desktop.

widersky avatar Jan 17 '24 10:01 widersky

This is a problem for me as well (running v0.119.16), and super annoying as well.

I don't have any projects open. When I launch Zed, it's to an empty/blank new file window.

I'll adjust the size and location of the new file window, to my liking. I then close Zed.

When I reopen Zed, the window doesn't have the previous size/location of the window and instead reverts to being max width/height of screen.

CC: @mikayla-maki @JosephTLyons

(Thanks for all the great work on Zed)

michealp-coder avatar Jan 24 '24 14:01 michealp-coder

+1, it's crucial. I'm using 32:9 ultra wide monitor + Rectangle for resizing my windows. I know probably using such monitor isn't good for coding, but usually I place all my windows in the center of the screen, and it's fine for me.

When I want to quickly edit some files (e.g. "Open With... -> Zed.app"), every time the editor opens full screen and I need to manually adjust the size of the window.

What's interesting, is that the editor does remember the last position, but particularly for a single file, and it's not possible to remember window size and position for other files that were not open yet.

My Jetbains products and vs code does remember size/position, but zed does not, which is huge blocker.

mekedron avatar Feb 29 '24 00:02 mekedron

My use case is that I always use Zed exclusively in fullscreen. If it can remember its size and position maybe it can also remember if it was fullscreen or not and open in the same way..

stjepangolemac avatar Feb 29 '24 12:02 stjepangolemac

This bug is related to https://github.com/zed-industries/zed/issues/4656 ("Window size & position are lost if I quit Zed in fullscreen")

michealp-coder avatar Mar 04 '24 22:03 michealp-coder

Piling on, but this is a real usability feature for making zed a default editor (or $EDITOR). That it fires up over the whole screen, and I immediately have to switch to mouse to fix that, is far from the end of the world, but vexing for ad hoc editor use cases.

I see it tagged into workspace serialization, but it's not really workspace level storage (if that is what I think it is), but usage as a text editor (replace vim/emacs) instead of IDE (replace VSCode/IDEA), outside of existing workspaces. New windows, even if not in an already used workspace, should not assume full-screen is the correct initial size.

brianm avatar Mar 06 '24 19:03 brianm

This should go out with v0.72.0.

@JosephTLyons , any updates on this?

It's been 1-year since you mentioned a fix for this would be pushed out.

michealp-coder avatar Mar 07 '24 03:03 michealp-coder

This should go out with v0.72.0.

@JosephTLyons , any updates on this?

It's been 1-year since you mentioned a fix for this would be pushed out.

I've proposed it as an item for our quality week sprint that will take place next week; I think we will have a meeting to iron out what will officially stick, so I'll update after that.

JosephTLyons avatar Mar 07 '24 04:03 JosephTLyons

This should go out with v0.72.0.

@JosephTLyons , any updates on this? It's been 1-year since you mentioned a fix for this would be pushed out.

I've proposed it as an item for our quality week sprint that will take place next week; I think we will have a meeting to iron out what will officially stick, so I'll update after that.

@JosephTLyons, thanks so much for all you do to manager the community.

michealp-coder avatar Mar 07 '24 14:03 michealp-coder

This should go out with v0.72.0.

@JosephTLyons , any updates on this? It's been 1-year since you mentioned a fix for this would be pushed out.

I've proposed it as an item for our quality week sprint that will take place next week; I think we will have a meeting to iron out what will officially stick, so I'll update after that.

@JosephTLyons, thanks so much for all you do to manager the community.

Thank you so much for the kind words! It means a lot to me. ❤️

JosephTLyons avatar Mar 11 '24 14:03 JosephTLyons

This has been implemented, and should be available on preview.

mikayla-maki avatar Mar 14 '24 16:03 mikayla-maki

Confirm, it works!!!

I'm running Zed Preview 0.127.1

When I close a window now, Zed remembers both the size and position.

Wahoo!

Many thanks Zed team

michealp-coder avatar Mar 14 '24 20:03 michealp-coder

@mikayla-maki @JosephTLyons

Yesterday I reported this was fixed, but today I'm having odd behavior.

For some reason now, every time I open Zed (either the app itself or a new window) - it's always about 1/2 width (of screen) and 1/2 height (of screen) centered to my monitor.

It is not persisting the size and window location I change it too.

Essentially, when this enhancement request was originally made - Zed was always opening full screen width & height. Now, Zed is always opening 1/2 width & height.

I don't think this Enhancement request is working properly.

In case it help, my Settings are below:

settings.json

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
  "telemetry": {
    "diagnostics": false,
    "metrics": false
  },
  "theme": "Atelier Estuary Light",
  "buffer_font_size": 12
}

Default Settings:

{
  // The name of the Zed theme to use for the UI
  "theme": "One Dark",
  // The name of a base set of key bindings to use.
  // This setting can take four values, each named after another
  // text editor:
  //
  // 1. "VSCode"
  // 2. "JetBrains"
  // 3. "SublimeText"
  // 4. "Atom"
  "base_keymap": "VSCode",
  // Features that can be globally enabled or disabled
  "features": {
    // Show Copilot icon in status bar
    "copilot": true
  },
  // The name of a font to use for rendering text in the editor
  "buffer_font_family": "Zed Mono",
  // The OpenType features to enable for text in the editor.
  "buffer_font_features": {
    // Disable ligatures:
    // "calt": false
  },
  // The default font size for text in the editor
  "buffer_font_size": 15,
  // Set the buffer's line height.
  // May take 3 values:
  //  1. Use a line height that's comfortable for reading (1.618)
  //         "line_height": "comfortable"
  //  2. Use a standard line height, (1.3)
  //         "line_height": "standard",
  //  3. Use a custom line height
  //         "line_height": {
  //           "custom": 2
  //         },
  "buffer_line_height": "comfortable",
  // The name of a font to use for rendering text in the UI
  "ui_font_family": "Zed Sans",
  // The OpenType features to enable for text in the UI
  "ui_font_features": {
    // Disable ligatures:
    "calt": false
  },
  // The default font size for text in the UI
  "ui_font_size": 16,
  // The factor to grow the active pane by. Defaults to 1.0
  // which gives the same size as all other panes.
  "active_pane_magnification": 1.0,
  // Whether to enable vim modes and key bindings
  "vim_mode": false,
  // Whether to show the informational hover box when moving the mouse
  // over symbols in the editor.
  "hover_popover_enabled": true,
  // Whether to confirm before quitting Zed.
  "confirm_quit": false,
  // Whether the cursor blinks in the editor.
  "cursor_blink": true,
  // Whether to pop the completions menu while typing in an editor without
  // explicitly requesting it.
  "show_completions_on_input": true,
  // Whether to display inline and alongside documentation for items in the
  // completions menu
  "show_completion_documentation": true,
  // The debounce delay before re-querying the language server for completion
  // documentation when not included in original completion list.
  "completion_documentation_secondary_query_debounce": 300,
  // Whether to show wrap guides in the editor. Setting this to true will
  // show a guide at the 'preferred_line_length' value if softwrap is set to
  // 'preferred_line_length', and will show any additional guides as specified
  // by the 'wrap_guides' setting.
  "show_wrap_guides": true,
  // Character counts at which to show wrap guides in the editor.
  "wrap_guides": [],
  // Hide the values of in variables from visual display in private files
  "redact_private_values": false,
  // Globs to match against file paths to determine if a file is private.
  "private_files": [
    "**/.env*",
    "**/*.pem",
    "**/*.key",
    "**/*.cert",
    "**/*.crt",
    "**/secrets.yml"
  ],
  // Whether to use additional LSP queries to format (and amend) the code after
  // every "trigger" symbol input, defined by LSP server capabilities.
  "use_on_type_format": true,
  // Whether to automatically type closing characters for you. For example,
  // when you type (, Zed will automatically add a closing ) at the correct position.
  "use_autoclose": true,
  // Controls whether copilot provides suggestion immediately
  // or waits for a `copilot::Toggle`
  "show_copilot_suggestions": true,
  // Whether to show tabs and spaces in the editor.
  // This setting can take three values:
  //
  // 1. Draw tabs and spaces only for the selected text (default):
  //    "selection"
  // 2. Do not draw any tabs or spaces:
  //   "none"
  // 3. Draw all invisible symbols:
  //   "all"
  "show_whitespaces": "selection",
  // Settings related to calls in Zed
  "calls": {
    // Join calls with the microphone live by default
    "mute_on_join": false,
    // Share your project when you are the first to join a channel
    "share_on_join": true
  },
  // Toolbar related settings
  "toolbar": {
    // Whether to show breadcrumbs.
    "breadcrumbs": true,
    // Whether to show quick action buttons.
    "quick_actions": true
  },
  // Scrollbar related settings
  "scrollbar": {
    // When to show the scrollbar in the editor.
    // This setting can take four values:
    //
    // 1. Show the scrollbar if there's important information or
    //    follow the system's configured behavior (default):
    //   "auto"
    // 2. Match the system's configured behavior:
    //    "system"
    // 3. Always show the scrollbar:
    //    "always"
    // 4. Never show the scrollbar:
    //    "never"
    "show": "auto",
    // Whether to show git diff indicators in the scrollbar.
    "git_diff": true,
    // Whether to show selections in the scrollbar.
    "selections": true,
    // Whether to show symbols selections in the scrollbar.
    "symbols_selections": true,
    // Whether to show diagnostic indicators in the scrollbar.
    "diagnostics": true
  },
  // What to do when multibuffer is double clicked in some of its excerpts
  // (parts of singleton buffers).
  // May take 2 values:
  //  1. Behave as a regular buffer and select the whole word (default).
  //         "double_click_in_multibuffer": "select"
  //  2. Open the excerpt clicked as a new buffer in the new tab.
  //         "double_click_in_multibuffer": "open",
  // For the case of "open", regular selection behavior can be achieved by holding `alt` when double clicking.
  "double_click_in_multibuffer": "select",
  "gutter": {
    // Whether to show line numbers in the gutter.
    "line_numbers": true,
    // Whether to show code action buttons in the gutter.
    "code_actions": true,
    // Whether to show fold buttons in the gutter.
    "folds": true
  },
  // The number of lines to keep above/below the cursor when scrolling.
  "vertical_scroll_margin": 3,
  "relative_line_numbers": false,
  // When to populate a new search's query based on the text under the cursor.
  // This setting can take the following three values:
  //
  // 1. Always populate the search query with the word under the cursor (default).
  //    "always"
  // 2. Only populate the search query when there is text selected
  //    "selection"
  // 3. Never populate the search query
  //    "never"
  "seed_search_query_from_cursor": "always",
  // Inlay hint related settings
  "inlay_hints": {
    // Global switch to toggle hints on and off, switched off by default.
    "enabled": false,
    // Toggle certain types of hints on and off, all switched on by default.
    "show_type_hints": true,
    "show_parameter_hints": true,
    // Corresponds to null/None LSP hint type value.
    "show_other_hints": true,
    // Time to wait after editing the buffer, before requesting the hints,
    // set to 0 to disable debouncing.
    "edit_debounce_ms": 700,
    // Time to wait after scrolling the buffer, before requesting the hints,
    // set to 0 to disable debouncing.
    "scroll_debounce_ms": 50
  },
  "project_panel": {
    // Default width of the project panel.
    "default_width": 240,
    // Where to dock the project panel. Can be 'left' or 'right'.
    "dock": "left",
    // Whether to show file icons in the project panel.
    "file_icons": true,
    // Whether to show folder icons or chevrons for directories in the project panel.
    "folder_icons": true,
    // Whether to show the git status in the project panel.
    "git_status": true,
    // Amount of indentation for nested items.
    "indent_size": 20,
    // Whether to reveal it in the project panel automatically,
    // when a corresponding project entry becomes active.
    // Gitignored entries are never auto revealed.
    "auto_reveal_entries": true
  },
  "collaboration_panel": {
    // Whether to show the collaboration panel button in the status bar.
    "button": true,
    // Where to dock the collaboration panel. Can be 'left' or 'right'.
    "dock": "left",
    // Default width of the collaboration panel.
    "default_width": 240
  },
  "chat_panel": {
    // Whether to show the chat panel button in the status bar.
    "button": true,
    // Where to the chat panel. Can be 'left' or 'right'.
    "dock": "right",
    // Default width of the chat panel.
    "default_width": 240
  },
  "message_editor": {
    // Whether to automatically replace emoji shortcodes with emoji characters.
    // For example: typing `:wave:` gets replaced with `👋`.
    "auto_replace_emoji_shortcode": true
  },
  "notification_panel": {
    // Whether to show the notification panel button in the status bar.
    "button": true,
    // Where to dock the notification panel. Can be 'left' or 'right'.
    "dock": "right",
    // Default width of the notification panel.
    "default_width": 380
  },
  "assistant": {
    // Whether to show the assistant panel button in the status bar.
    "button": true,
    // Where to dock the assistant panel. Can be 'left', 'right' or 'bottom'.
    "dock": "right",
    // Default width when the assistant is docked to the left or right.
    "default_width": 640,
    // Default height when the assistant is docked to the bottom.
    "default_height": 320,
    // Deprecated: Please use `provider.api_url` instead.
    // The default OpenAI API endpoint to use when starting new conversations.
    "openai_api_url": "https://api.openai.com/v1",
    // Deprecated: Please use `provider.default_model` instead.
    // The default OpenAI model to use when starting new conversations. This
    // setting can take three values:
    //
    // 1. "gpt-3.5-turbo-0613""
    // 2. "gpt-4-0613""
    // 3. "gpt-4-1106-preview"
    "default_open_ai_model": "gpt-4-1106-preview",
    "provider": {
      "type": "openai",
      // The default OpenAI API endpoint to use when starting new conversations.
      "api_url": "https://api.openai.com/v1",
      // The default OpenAI model to use when starting new conversations. This
      // setting can take three values:
      //
      // 1. "gpt-3.5-turbo-0613""
      // 2. "gpt-4-0613""
      // 3. "gpt-4-1106-preview"
      "default_model": "gpt-4-1106-preview"
    }
  },
  // Whether the screen sharing icon is shown in the os status bar.
  "show_call_status_icon": true,
  // Whether to use language servers to provide code intelligence.
  "enable_language_server": true,
  // When to automatically save edited buffers. This setting can
  // take four values.
  //
  // 1. Never automatically save:
  //     "autosave": "off",
  // 2. Save when changing focus away from the Zed window:
  //     "autosave": "on_window_change",
  // 3. Save when changing focus away from a specific buffer:
  //     "autosave": "on_focus_change",
  // 4. Save when idle for a certain amount of time:
  //     "autosave": { "after_delay": {"milliseconds": 500} },
  "autosave": "off",
  // Settings related to the editor's tabs
  "tabs": {
    // Show git status colors in the editor tabs.
    "git_status": false,
    // Position of the close button on the editor tabs.
    "close_position": "right"
  },
  // Whether or not to remove any trailing whitespace from lines of a buffer
  // before saving it.
  "remove_trailing_whitespace_on_save": true,
  // Whether to start a new line with a comment when a previous line is a comment as well.
  "extend_comment_on_newline": true,
  // Whether or not to ensure there's a single newline at the end of a buffer
  // when saving it.
  "ensure_final_newline_on_save": true,
  // Whether or not to perform a buffer format before saving
  "format_on_save": "on",
  // How to perform a buffer format. This setting can take 4 values:
  //
  // 1. Format code using the current language server:
  //     "formatter": "language_server"
  // 2. Format code using an external command:
  //     "formatter": {
  //       "external": {
  //         "command": "prettier",
  //         "arguments": ["--stdin-filepath", "{buffer_path}"]
  //       }
  //     }
  // 3. Format code using Zed's Prettier integration:
  //     "formatter": "prettier"
  // 4. Default. Format files using Zed's Prettier integration (if applicable),
  //    or falling back to formatting via language server:
  //     "formatter": "auto"
  "formatter": "auto",
  // How to soft-wrap long lines of text. This setting can take
  // three values:
  //
  // 1. Do not soft wrap.
  //      "soft_wrap": "none",
  // 2. Soft wrap lines that overflow the editor:
  //      "soft_wrap": "editor_width",
  // 3. Soft wrap lines at the preferred line length
  //      "soft_wrap": "preferred_line_length",
  "soft_wrap": "none",
  // The column at which to soft-wrap lines, for buffers where soft-wrap
  // is enabled.
  "preferred_line_length": 80,
  // Whether to indent lines using tab characters, as opposed to multiple
  // spaces.
  "hard_tabs": false,
  // How many columns a tab should occupy.
  "tab_size": 4,
  // Control what info is collected by Zed.
  "telemetry": {
    // Send debug info like crash reports.
    "diagnostics": true,
    // Send anonymized usage data like what languages you're using Zed with.
    "metrics": true
  },
  // Automatically update Zed
  "auto_update": true,
  // Diagnostics configuration.
  "diagnostics": {
    // Whether to show warnings or not by default.
    "include_warnings": true
  },
  // Add files or globs of files that will be excluded by Zed entirely:
  // they will be skipped during FS scan(s), file tree and file search
  // will lack the corresponding file entries.
  "file_scan_exclusions": [
    "**/.git",
    "**/.svn",
    "**/.hg",
    "**/CVS",
    "**/.DS_Store",
    "**/Thumbs.db",
    "**/.classpath",
    "**/.settings"
  ],
  // Git gutter behavior configuration.
  "git": {
    // Control whether the git gutter is shown. May take 2 values:
    // 1. Show the gutter
    //      "git_gutter": "tracked_files"
    // 2. Hide the gutter
    //      "git_gutter": "hide"
    "git_gutter": "tracked_files"
  },
  "copilot": {
    // The set of glob patterns for which copilot should be disabled
    // in any matching file.
    "disabled_globs": [".env"]
  },
  // Settings specific to journaling
  "journal": {
    // The path of the directory where journal entries are stored
    "path": "~",
    // What format to display the hours in
    // May take 2 values:
    // 1. hour12
    // 2. hour24
    "hour_format": "hour12"
  },
  // Settings specific to the terminal
  "terminal": {
    // What shell to use when opening a terminal. May take 3 values:
    // 1. Use the system's default terminal configuration in /etc/passwd
    //      "shell": "system"
    // 2. A program:
    //      "shell": {
    //        "program": "sh"
    //      }
    // 3. A program with arguments:
    //     "shell": {
    //         "with_arguments": {
    //           "program": "/bin/bash",
    //           "arguments": ["--login"]
    //         }
    //     }
    "shell": "system",
    // Where to dock terminals panel. Can be 'left', 'right', 'bottom'.
    "dock": "bottom",
    // Default width when the terminal is docked to the left or right.
    "default_width": 640,
    // Default height when the terminal is docked to the bottom.
    "default_height": 320,
    // What working directory to use when launching the terminal.
    // May take 4 values:
    // 1. Use the current file's project directory.  Will Fallback to the
    //    first project directory strategy if unsuccessful
    //      "working_directory": "current_project_directory"
    // 2. Use the first project in this workspace's directory
    //      "working_directory": "first_project_directory"
    // 3. Always use this platform's home directory (if we can find it)
    //     "working_directory": "always_home"
    // 4. Always use a specific directory. This value will be shell expanded.
    //    If this path is not a valid directory the terminal will default to
    //    this platform's home directory  (if we can find it)
    //      "working_directory": {
    //        "always": {
    //          "directory": "~/zed/projects/"
    //        }
    //      }
    "working_directory": "current_project_directory",
    // Set the cursor blinking behavior in the terminal.
    // May take 3 values:
    //  1. Never blink the cursor, ignoring the terminal mode
    //         "blinking": "off",
    //  2. Default the cursor blink to off, but allow the terminal to
    //     set blinking
    //         "blinking": "terminal_controlled",
    //  3. Always blink the cursor, ignoring the terminal mode
    //         "blinking": "on",
    "blinking": "terminal_controlled",
    // Set whether Alternate Scroll mode (code: ?1007) is active by default.
    // Alternate Scroll mode converts mouse scroll events into up / down key
    // presses when in the alternate screen (e.g. when running applications
    // like vim or  less). The terminal can still set and unset this mode.
    // May take 2 values:
    //  1. Default alternate scroll mode to on
    //         "alternate_scroll": "on",
    //  2. Default alternate scroll mode to off
    //         "alternate_scroll": "off",
    "alternate_scroll": "off",
    // Set whether the option key behaves as the meta key.
    // May take 2 values:
    //  1. Rely on default platform handling of option key, on macOS
    //     this means generating certain unicode characters
    //         "option_to_meta": false,
    //  2. Make the option keys behave as a 'meta' key, e.g. for emacs
    //         "option_to_meta": true,
    "option_as_meta": false,
    // Whether or not selecting text in the terminal will automatically
    // copy to the system clipboard.
    "copy_on_select": false,
    // Any key-value pairs added to this list will be added to the terminal's
    // environment. Use `:` to separate multiple values.
    "env": {
      // "KEY": "value1:value2"
    },
    // Set the terminal's line height.
    // May take 3 values:
    //  1. Use a line height that's comfortable for reading, 1.618
    //         "line_height": "comfortable"
    //  2. Use a standard line height, 1.3. This option is useful for TUIs,
    //      particularly if they use box characters
    //         "line_height": "standard",
    //  3. Use a custom line height.
    //         "line_height": {
    //           "custom": 2
    //         },
    "line_height": "comfortable",
    // Activate the python virtual environment, if one is found, in the
    // terminal's working directory (as resolved by the working_directory
    // setting). Set this to "off" to disable this behavior.
    "detect_venv": {
      "on": {
        // Default directories to search for virtual environments, relative
        // to the current working directory. We recommend overriding this
        // in your project's settings, rather than globally.
        "directories": [".env", "env", ".venv", "venv"],
        // Can also be 'csh', 'fish', and `nushell`
        "activate_script": "default"
      }
    },
    "toolbar": {
      // Whether to display the terminal title in its toolbar.
      "title": true
    }
    // Set the terminal's font size. If this option is not included,
    // the terminal will default to matching the buffer's font size.
    // "font_size": 15,
    // Set the terminal's font family. If this option is not included,
    // the terminal will default to matching the buffer's font family.
    // "font_family": "Zed Mono",
    // Sets the maximum number of lines in the terminal's scrollback buffer.
    // Default: 10_000, maximum: 100_000 (all bigger values set will be treated as 100_000), 0 disables the scrolling.
    // Existing terminals will not pick up this change until they are recreated.
    // "max_scroll_history_lines": 10000,
  },
  // Difference settings for semantic_index
  "semantic_index": {
    "enabled": true
  },
  // Settings specific to our elixir integration
  "elixir": {
    // Change the LSP zed uses for elixir.
    // Note that changing this setting requires a restart of Zed
    // to take effect.
    //
    // May take 3 values:
    //  1. Use the standard ElixirLS, this is the default
    //         "lsp": "elixir_ls"
    //  2. Use the experimental NextLs
    //         "lsp": "next_ls",
    //  3. Use a language server installed locally on your machine:
    //         "lsp": {
    //           "local": {
    //             "path": "~/next-ls/bin/start",
    //             "arguments": ["--stdio"]
    //            }
    //          },
    //
    "lsp": "elixir_ls"
  },
  // Settings specific to our deno integration
  "deno": {
    "enable": false
  },
  "code_actions_on_format": {},
  // Different settings for specific languages.
  "languages": {
    "Plain Text": {
      "soft_wrap": "preferred_line_length"
    },
    "Elixir": {
      "tab_size": 2
    },
    "Gleam": {
      "tab_size": 2
    },
    "Go": {
      "tab_size": 4,
      "hard_tabs": true,
      "code_actions_on_format": {
        "source.organizeImports": true
      }
    },
    "Markdown": {
      "tab_size": 2,
      "soft_wrap": "preferred_line_length"
    },
    "JavaScript": {
      "tab_size": 2
    },
    "Terraform": {
      "tab_size": 2
    },
    "TypeScript": {
      "tab_size": 2
    },
    "TSX": {
      "tab_size": 2
    },
    "YAML": {
      "tab_size": 2
    },
    "JSON": {
      "tab_size": 2
    },
    "OCaml": {
      "tab_size": 2
    },
    "OCaml Interface": {
      "tab_size": 2
    }
  },
  // Zed's Prettier integration settings.
  // If Prettier is enabled, Zed will use this its Prettier instance for any applicable file, if
  // project has no other Prettier installed.
  "prettier": {
    // Use regular Prettier json configuration:
    // "trailingComma": "es5",
    // "tabWidth": 4,
    // "semi": false,
    // "singleQuote": true
  },
  // LSP Specific settings.
  "lsp": {
    // Specify the LSP name as a key here.
    // "rust-analyzer": {
    //     // These initialization options are merged into Zed's defaults
    //     "initialization_options": {
    //         "check": {
    //             "command": "clippy" // rust-analyzer.check.command (default: "check")
    //         }
    //     }
    // }
  },
  // Vim settings
  "vim": {
    "use_system_clipboard": "always",
    "use_multiline_find": false,
    "use_smartcase_find": false
  },
  // The server to connect to. If the environment variable
  // ZED_SERVER_URL is set, it will override this setting.
  "server_url": "https://zed.dev",
  // Settings overrides to use when using Zed Preview.
  // Mostly useful for developers who are managing multiple instances of Zed.
  "preview": {
    // "theme": "Andromeda"
  },
  // Settings overrides to use when using Zed Nightly.
  // Mostly useful for developers who are managing multiple instances of Zed.
  "nightly": {
    // "theme": "Andromeda"
  },
  // Settings overrides to use when using Zed Stable.
  // Mostly useful for developers who are managing multiple instances of Zed.
  "stable": {
    // "theme": "Andromeda"
  },
  // Settings overrides to use when using Zed Dev.
  // Mostly useful for developers who are managing multiple instances of Zed.
  "dev": {
    // "theme": "Andromeda"
  }
}

michealp-coder avatar Mar 15 '24 14:03 michealp-coder

THANK YOU THANK YOU THANK YOU!

brianm avatar Mar 15 '24 14:03 brianm

THANK YOU THANK YOU THANK YOU!

@brianm are you noticing the same strange behavior I am, as indicated in my previous comment?

michealp-coder avatar Mar 15 '24 16:03 michealp-coder

@michealp-coder Ugh, you are right, I am able to replicate that. It remembers a smaller size, so the experience is better, but it

  1. Doesn't remember the actual last window size
  2. Doesn't remember the window location

I have tried a few sizes and locations. If I quit zed, then open foo.txt from the shell, I get two windows -- foo.txt and the most recent project I have opened. It feels like the project window is influencing the one-off window, but I may be seeing patterns in tea leaves

brianm avatar Mar 15 '24 18:03 brianm

@mikayla-maki @JosephTLyons unfortunately, this is not working (as originally thought).

Can this Enhancement request be reopened?

See both my last few comment & brianm for more detail.

michealp-coder avatar Mar 15 '24 19:03 michealp-coder

If I leave it running and just close windows (splat-shift-w) instead of quitting it behaves pretty nicely. Not perfect, but treat as emacs-daemon and things work :-)

brianm avatar Mar 15 '24 19:03 brianm