# LibTmux.Workspace.WorkspaceWindow.WithDefaults

- **Module:** LibTmux.Workspace
- **Package:** LibTmux.Workspace
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.Workspace/WorkspaceFile.cs#L175
- **Page:** https://libtmux.org/en/csharp/latest/workspace/reference/libtmux-workspace-workspacewindow-withdefaults/

```
LibTmux.Workspace.WorkspaceWindow.WithDefaults(environment: IReadOnlyDictionary<string, string>?, shellCommandsBefore: IReadOnlyList<string>?, beforeCommands: IReadOnlyList<WorkspaceCommand>?) -> WorkspaceWindow
```

Returns a declaration with replacement environment and pre-command defaults.

## Parameters

- `environment` (`IReadOnlyDictionary<string, string>?`): The local entries to copy, or null to preserve the existing entries.
- `shellCommandsBefore` (`IReadOnlyList<string>?`): The local commands to copy, or null to preserve the existing commands.
- `beforeCommands` (`IReadOnlyList<WorkspaceCommand>?`): Typed local commands; use instead of <paramref name="shellCommandsBefore" />.

## Returns

A new declaration; empty collections clear the corresponding defaults.

## Raises

- [`ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): An environment name is empty or contains '=' or NUL, or a value contains NUL.
