Skip to content

[FEATURE REQUEST] Duplicate a session from a right press on its row, and drag rows to reorder them - #9

Merged
Raiden-MeixElysia merged 1 commit into
ELY-Open-Source:mainfrom
miaoaa66:session-menu-and-reorder
Oct 22, 2026
Merged

Raiden-MeixElysia merged 1 commit into
ELY-Open-Source:mainfrom
miaoaa66:session-menu-and-reorder

Conversation

@miaoaa66

Copy link
Copy Markdown
Contributor

Type

  • [FEATURE REQUEST]: a new feature or an improvement
  • [BUG REPORT]: a bug fix
  • [Other]: docs, refactoring, CI, dependencies or chores

What and why

A right press on a session's row opens a menu at the pointer with Duplicate session and Close session around a separator. Duplicate session opens a session of the shell that row runs, in the folder it last reported, right after the row and shown: a PowerShell row opens PowerShell, a cmd row cmd. A drag on a row moves it to another place in the column, and the session shown stays shown.

How it was tested

  • cargo check --all-targets, cargo clippy --all-targets -- -D warnings and cargo test on Windows: 239 tests pass, no warning. My machine has no MSVC and no Windows SDK, so this ran on the x86_64-pc-windows-gnu target; the msvc job on CI would be the first msvc build.
  • By hand, in the app built from this branch, on Windows: a right press on a PowerShell row opened the menu, and Duplicate session opened a PowerShell session in the same folder the row showed; a drag moved rows to new places and the list kept the order.
  • workspace::reorder::tests keeps the shown index on its row as rows cross it either way.
  • Not checked by hand: Duplicate session on a cmd row. cmd has no shell integration, so its row shows the folder it started in and a duplicate starts there too; PRD.md says so.
  • A release build needs the MSVC toolchain with the Windows SDK for fxc.exe, which compiles gpui's shaders, so I could not run one here.

Checklist

  • The title starts with [FEATURE REQUEST], [BUG REPORT] or [Other]
  • Tests and the build pass locally
  • Docs are updated if behaviour changed

Notes

  • A session now keeps the program it started (Session::shell, taken from Launch::program), so duplicating it asks launch for the same shell and gets the same integration back. An empty one means the login shell, as the settings mean it.
  • Both menu rows act on the row's EntityId, not its place, so a row that moves or closes while the menu is open cannot take another row's action.
  • The column is Ely's Reorder rather than lists::List, since SortableList takes only ListItems and a ListItem carries no menu of its own. That drops SortableList's grip icon and its Alt-Up/Alt-Down move, which can come back on top of Reorder if wanted.
  • new_session moved to src/workspace/session.rs and shares open with duplicate, since workspace.rs stood at 494 of its 500 lines. PRD.md section 7, README.md, TASKS.md (T67, T68) and tasks/acceptance.md section 7 carry the change.

… and folder it runs, or closes it, and a drag moves the row

A session keeps the program it started, so Duplicate session opens that program
again in the folder the row last reported, right after the row and shown: a
PowerShell row opens PowerShell, a cmd row cmd. Close session closes the row.
Both act on the row's EntityId rather than its place, so a row that moves while
the menu is open cannot take another row's place. A shell that reports no
folder, as cmd does, duplicates into the folder it started in.

The column is Ely's Reorder now, so a drag moves a row to another place and the
session shown stays shown. Ely's SortableList takes only ListItems, which carry
no menu of their own, so the rows are built from Reorder and a ContextMenu.

Tested on Windows with the x86_64-pc-windows-gnu target, the only one this
machine can link: cargo check --all-targets, cargo clippy --all-targets with
-D warnings and cargo test, 239 passing. The owner right-pressed a PowerShell
row and got a PowerShell session in the same folder, and dragged rows to new
places.
@Raiden-MeixElysia
Raiden-MeixElysia merged commit 628356e into ELY-Open-Source:main Oct 22, 2026
Raiden-MeixElysia added a commit that referenced this pull request Oct 22, 2026
… duplicates or closes, a drag moves a row, and a double press still renames
@Raiden-MeixElysia

Copy link
Copy Markdown
Contributor

Thanks for the PR! Merged and shipped in v0.1.8. https://github.com/ELY-Open-Source/ELYTerminal/releases/tag/v0.1.8

Raiden-MeixElysia added a commit that referenced this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants