Vitaly Slobodin
b55e8383c8
terminal: Fix Python virtual environment detection ( #15989 )
...
A Python virtual environment places a copy of the Python interpreter and
related files into a special directory, such as `.env` or `env`.
Currently, the built-in Zed terminal does not check if any entries
specified in `terminal.detect_venv.directories` are directories. If a
regular file with the same name exists, the terminal incorrectly
attempts to activate it as a virtual environment. The fix is to ensure
that an entry is a directory before attempting to activate the virtual
environment.
Here are screenshots of 3 possible scenarios:
# With a regular file `.env` in the worktree
## Before

## After

# With a directory called `.env` in the worktree

Release Notes:
- Fixed detection of Python virtual environments
([#15570 ](https://github.com/zed-industries/zed/issues/15570 )).
2024-08-14 21:33:02 +03:00
Conrad Irwin
583b6235fb
SSH remoting: terminal & tasks ( #15321 )
...
This also rolls back the `TerminalWorkDir` abstraction I added for the
original remoting, and tidies up the terminal creation code to be clear
about whether we're creating a task *or* a terminal. The previous logic
was a little muddy because it assumed we could be doing both at the same
time (which was not true).
Release Notes:
- remoting alpha: Removed the ability to specify `gh cs ssh` or `gcloud
compute ssh` etc. See https://zed.dev/docs/remote-development for
alternatives.
- remoting alpha: Added support for terminal and tasks to new
experimental ssh remoting
2024-07-28 22:45:00 -06:00
Kirill Bulatov
b2b9d4ccb6
Extend task templates with shell
and hide
fields to use custom shells and custom close behavior ( #15031 )
2024-07-23 22:58:36 +03:00
Conrad Irwin
62ab6e1a11
remoting: Allow Add/Remove remote folder ( #14532 )
...
Release Notes:
- remoting (alpha only): Allow add/remove folders to projects
---------
Co-authored-by: Max <max@zed.dev>
2024-07-16 12:01:59 -06:00
Donough Liu
d49727ff10
terminal: Set TERM_PROGRAM
and TERM_PROGRAM_VERSION
environment variables in integrated terminal ( #14213 )
...

These two environment variables are essential when people need to detect
terminal type and do something. Many popular terminals set them.
fixes https://github.com/zed-industries/zed/issues/4571
Release Notes:
- Set `TERM_PROGRAM` and `TERM_PROGRAM_VERSION` environment variables in
the integrated terminal
([#4571 ](https://github.com/zed-industries/zed/issues/4571 )).
2024-07-11 20:48:46 +03:00
Conrad Irwin
4e98c23463
Reconnect button for remote projects ( #12669 )
...
Release Notes:
- N/A
---------
Co-authored-by: Max <max@zed.dev>
2024-06-10 18:09:47 -06:00
Jason Lee
ae55d35f19
windows: Fix project prepare_ssh_shell to support setting PATH on Windows ( #12370 )
...
Release Notes:
- N/A
Update to use `std::env::join_paths` to prepare `PATH` env.
Ref
https://github.com/zed-industries/zed/pull/12087#issuecomment-2122852384
@mrnugget
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-06-03 11:57:50 +02:00
Kirill Bulatov
0f927fa6fb
One less unwrap ( #12448 )
...
Fixes
https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1717011343884699
Release Notes:
- N/A
2024-05-29 23:44:56 +03:00
Kirill Bulatov
c4e87444e7
Tidy up the code ( #12116 )
...
Small follow-ups for https://github.com/zed-industries/zed/pull/12063
and https://github.com/zed-industries/zed/pull/12103
Release Notes:
- N/A
2024-05-22 14:36:15 +03:00
Conrad Irwin
e5b9e2044e
Allow ssh connection for setting up zed ( #12063 )
...
Co-Authored-By: Mikayla <mikayla@zed.dev>
Release Notes:
- Magic `ssh` login feature for remote development
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2024-05-21 22:39:16 -06:00
Kirill Bulatov
8631280baa
Support terminals with ssh in remote projects ( #11913 )
...
Release Notes:
- Added a way to create terminal tabs in remote projects, if an ssh
connection string is specified
2024-05-17 17:48:07 +03:00
LoganDark
45aca348b8
Take local project settings into account when launching terminals ( #11526 )
...
Fixes #7599
Use project level settings if possible, when creating terminals.
Release Notes:
- Fixed terminals ignoring project-specific settings ([7599](https://github.com/zed-industries/zed/issues/7599 ))
2024-05-08 13:39:47 +03:00
Kirill Bulatov
13c17267b9
Properly pass nested script arguments for tasks ( #10776 )
...
Closes
https://github.com/zed-industries/zed/discussions/10732#discussion-6524347
introduced by https://github.com/zed-industries/zed/pull/10548 while
keeping both Python and Bash run selection capabilities.
Also replaced redundant `SpawnTask` struct with `SpawnInTerminal` that
has identical fields.
Release Notes:
- Fixed incorrect task escaping of nested script arguments
---------
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
2024-04-19 16:24:35 +03:00
Kirill Bulatov
be2bf98529
Show task summary in its terminal after it stops running ( #10615 )
...
Based on https://github.com/alacritty/alacritty/issues/7795
Unknown error code commands (now includes the interrupted ones):

Successful command:

Unsuccessful command:

The "design", including wordings and special characters, is not final,
suggestions are welcome.
The main idea was to somehow distinguish the appended lines without
occupying extra vertical space.
Release Notes:
- Added task summary output into corresponding terminal tabs
2024-04-16 22:13:35 +03:00
Kirill Bulatov
db48c75231
Add basic bash and Python tasks ( #10548 )
...
Part of https://github.com/zed-industries/zed/issues/5141
* adds "run selection" and "run file" tasks for bash and Python.
* replaces newlines with `\n` symbols in the human-readable task labels
* properly escapes task command arguments when spawning the task in
terminal
Caveats:
* bash tasks will always use user's default shell to spawn the
selections, but they should rather respect the shebang line even if it's
not selected
* Python tasks will always use `python3` to spawn its tasks now, as
there's no proper mechanism in Zed to deal with different Python
executables
Release Notes:
- Added tasks for bash and Python to execute selections and open files
in terminal
2024-04-15 16:07:21 +03:00
Piotr Osiewicz
a1cbc23fee
task: use full task label to distinguish a terminal ( #10469 )
...
Spotted by @SomeoneToIgnore, in #10468 I've used a shortened task label,
which might lead to collisions.
Release Notes:
- N/A
2024-04-12 13:25:46 +02:00
Kirill Bulatov
ce37885f49
Use different icons for terminal tasks ( #9876 )
2024-03-27 20:49:10 +01:00
Stanislav Alekseev
3b7cd9cf1e
Remove incorrect venv base directory used ( #9661 )
...
Follow-up of https://github.com/zed-industries/zed/pull/8444
Release Notes:
- N/A
2024-03-21 21:34:14 +02:00
Stanislav Alekseev
85fdcef564
Do not enable venv in terminal for bash-like oneshot task invocations ( #8444 )
...
Release Notes:
- Work around #8334 by only activating venv in the terminal not in tasks
(see #8440 for a proper solution)
- To use venv modify your tasks in the following way:
```json
{
"label": "Python main.py",
"command": "sh",
"args": ["-c", "source .venv/bin/activate && python3 main.py"]
}
```
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-03-21 19:40:33 +02:00
Kirill Bulatov
2679457b02
Rename runnables into tasks ( #8119 )
...
Release Notes:
- N/A
2024-02-21 14:56:43 +02:00
Kirill Bulatov
0d2ad67b27
Add settings to configure terminal scroll limit ( #8063 )
...
Fixes https://github.com/zed-industries/zed/issues/7550
Also set maximum allowed to runnables' terminals.
Release Notes:
- Added settings to configure terminal scroll limit
([7550](https://github.com/zed-industries/zed/issues/7550 ))
2024-02-20 16:14:59 +02:00
Piotr Osiewicz
f17d0b5729
Add static Runnables ( #8009 )
...
Part of #7108
This PR includes just the static runnables part. We went with **not**
having a dedicated panel for runnables.
This is just a 1st PR out of N, as we want to start exploring the
dynamic runnables front. Still, all that work is going to happen once
this gets merged.
Release Notes:
- Added initial, static Runnables support to Zed. Such runnables are defined in
`runnables.json` file (accessible via `zed: open runnables` action) and
they can be spawned with `runnables: spawn` action.
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Pitor <pitor@zed.dev>
Co-authored-by: Beniamin <beniamin@zagan.be>
2024-02-19 18:41:43 +02:00
Leon
54f82eb166
Add double quote wrap in activate_python_virtual_environment ( #7787 )
...
Added double quote wrap in activate_python_virtual_environment to handle
spaces in path.
Would fail to find venv activate script when spaces exist.
Release Notes:
- Fixed venv_detection activation not finding directory if space is in
the path

- With changes

2024-02-14 12:42:06 -08:00
Mikayla
3734a390b2
Mark TODOs and prep for merging main
2024-02-07 11:39:26 -08:00
Dzmitry Malyshau
2e32f5867e
linux: various fixes across the crates to make it compile
2024-02-03 00:06:20 -08:00
Tristam MacDonald
3847762d8c
Activate the nushell virtualenv overlay correctly
...
The activate.nu file works a little differently than it's counterparts in other shells, and it needs to be invoked as an overlay, rather than sourced directly into the shell.
This fixes an outstanding issues left over from #6323 .
2024-01-26 12:52:28 +01:00
Piotr Osiewicz
6c82380232
chore: Fix clippy::needless_borrow up to an editor
2024-01-21 15:03:24 +01:00
Max Brunsfeld
c5a1950522
Remove 2 suffix for project
...
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:53:34 -08:00
Joseph T. Lyons
e5e63ed201
Add Nushell support to venv activation
2023-10-01 23:38:30 -04:00
Joseph T. Lyons
507a5db09c
WIP
...
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-08-25 15:06:31 -04:00
Joseph T. Lyons
9fe580acb6
WIP
2023-08-25 01:50:54 -04:00
Joseph T. Lyons
7b170304df
Shorten setting name
2023-08-23 04:07:10 -04:00
Joseph T. Lyons
711f156308
WIP
2023-08-23 04:04:36 -04:00
Joseph T. Lyons
471810a3c2
WIP
...
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-08-22 15:29:25 -04:00
Nathan Sobo
0a4633f88f
Remove more window id usage
2023-08-08 11:20:09 -06:00
Max Brunsfeld
2d5f03e148
Remove optional path argument when getting settings
2023-05-17 15:05:20 -07:00
Max Brunsfeld
bc5b78198a
Define terminal settings in terminal crate
2023-05-10 17:43:10 -07:00
Petros Amoiridis
d5bb2d13b8
Introduce terminal button count
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-03-22 16:13:58 +02:00
Joseph Lyons
caa6a75238
Show a pop up menu for terminals
...
Co-Authored-By: Joseph T. Lyons <19867440+JosephTLyons@users.noreply.github.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2023-03-07 20:16:08 +02:00
Joseph Lyons
3ec71a742d
Keep track of open terminals
...
Co-Authored-By: Petros Amoiridis <petros@hey.com>
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-03-03 12:50:08 -08:00