Skip to content

Conversation

@baldwindavid
Copy link
Contributor

@baldwindavid baldwindavid commented Jan 10, 2026

This PR adds the ability to open local terminals when working in remote projects. When working in a remote (often actually remoting into a local container) I always need to run separate terminals outside Zed so I can run local build tools, scripts, agents, etc. for the related project. I'd like to be able to run all of these in the same Zed window and this adds that ability via one-off local terminals.

Changes

Adds an optional local parameter to terminal commands. When set to true, creates a local shell on your machine instead of connecting to the remote.

Implementation

  • Added force_local parameter to terminal creation logic
  • Created create_local_terminal() method that bypasses remote client
  • Updated terminal actions (NewTerminal, NewCenterTerminal) to accept optional local: bool field (defaults to false)

Usage

Via keybinding:

{
  "bindings": {
    "cmd-t": "workspace::NewCenterTerminal",
    "cmd-T": ["workspace::NewCenterTerminal", { "local": true }]
  }
},
{
  "context": "Terminal",
  "bindings": {
    "cmd-n": "workspace::NewTerminal",
    "cmd-N": ["workspace::NewTerminal", { "local": true }],
  },
},

Behavior:

  • Default terminal commands continue to work as before (remote in remote projects, local in local projects)
  • The local parameter is optional and defaults to false

Release Notes:

  • Added support for opening local terminals in remote projects via local parameter on terminal commands.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 10, 2026
@baldwindavid baldwindavid changed the title Support local terminals in remote projects Jan 10, 2026
@baldwindavid baldwindavid changed the title remote: support local terminals in remote projects Jan 10, 2026
@Veykril Veykril self-assigned this Jan 12, 2026
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally sounds useful to me, one minor question.

Comment on lines 288 to 297
/// Creates a local terminal even if the project is remote.
/// Used for "breaking out" of remote to access local shell.
/// The terminal will open in the Zed process's current directory,
/// which is where Zed was launched from (if via CLI) or home directory (if via app icon).
pub fn create_local_terminal(
&mut self,
cx: &mut Context<Self>,
) -> Task<Result<Entity<Terminal>>> {
self.create_terminal_shell_internal(None, true, cx)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeing this, that means if one uses the local terminal creation action in a local project one will not get a relevant working directory either way (despite having one available in theory). I feel like it'd be nice to make that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! That's been fixed in 8b3e4e0

Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Veykril Veykril enabled auto-merge (squash) January 13, 2026 07:32
auto-merge was automatically disabled January 13, 2026 15:47

Head branch was pushed to by a user without write access

@Veykril Veykril enabled auto-merge (squash) January 13, 2026 16:29
@Veykril Veykril merged commit d7bce54 into zed-industries:main Jan 13, 2026
22 of 23 checks passed
rtfeldman pushed a commit that referenced this pull request Jan 13, 2026
This PR adds the ability to open local terminals when working in remote
projects. When working in a remote (often actually remoting into a local
container) I always need to run separate terminals outside Zed so I can
run local build tools, scripts, agents, etc. for the related project.
I'd like to be able to run all of these in the same Zed window and this
adds that ability via one-off local terminals.

## Changes

Adds an optional `local` parameter to terminal commands. When set to
`true`, creates a local shell on your machine instead of connecting to
the remote.

### Implementation
- Added `force_local` parameter to terminal creation logic
- Created `create_local_terminal()` method that bypasses remote client
- Updated terminal actions (`NewTerminal`, `NewCenterTerminal`) to
accept optional `local: bool` field (defaults to `false`)

### Usage

**Via keybinding:**
```json
{
  "bindings": {
    "cmd-t": "workspace::NewCenterTerminal",
    "cmd-T": ["workspace::NewCenterTerminal", { "local": true }]
  }
},
{
  "context": "Terminal",
  "bindings": {
    "cmd-n": "workspace::NewTerminal",
    "cmd-N": ["workspace::NewTerminal", { "local": true }],
  },
},
```

**Behavior:**
- Default terminal commands continue to work as before (remote in remote
projects, local in local projects)
- The `local` parameter is optional and defaults to `false`

Release Notes:

- Added support for opening local terminals in remote projects via
`local` parameter on terminal commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

2 participants