-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.wezterm.lua
More file actions
785 lines (713 loc) Β· 23.9 KB
/
Copy path.wezterm.lua
File metadata and controls
785 lines (713 loc) Β· 23.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
local wezterm = require 'wezterm'
local act = wezterm.action
-- Configuration table
local config = {}
-- Use config builder if available (newer versions)
if wezterm.config_builder then
config = wezterm.config_builder()
end
-- Import the theme from neapsix/wezterm
-- Import rose-pine.lua file to C:\Users\Admin\.config\wezterm\lua
-- Shorcut Target "C:\Program Files\WezTerm\wezterm-gui.exe" start -- wsl.exe --cd /mnt/c
local theme = require('lua/rose-pine').main
config.colors = theme.colors()
config.colors.background = '#161625'
-- REMOVE ALL "config.colors" PARAMETERS FOR THIS TO WORK!!
--config.color_scheme = 'The Hulk'
-- Make ANSI colors more vibrant
config.colors.ansi = {
'#000000', -- Black (unchanged)
'#FF5555', -- Bright Red (was probably more muted)
'#50FA7B', -- Bright Green
'#F1FA8C', -- Bright Yellow
'#BD93F9', -- Bright Purple/Blue
'#FF79C6', -- Bright Pink/Magenta
'#8BE9FD', -- Bright Cyan
'#F8F8F2', -- Bright White
}
-- Make bright ANSI colors even more vibrant
config.colors.brights = {
'#6272A4', -- Bright Black (gray)
'#FF6E6E', -- Bright Red
'#69FF94', -- Bright Green
'#FFFFA5', -- Bright Yellow
'#D6ACFF', -- Bright Blue
'#FF92DF', -- Bright Magenta
'#A4FFFF', -- Bright Cyan
'#FFFFFF', -- Bright White
}
-- Scrollbar color override (without affecting theme)
config.colors.scrollbar_thumb = "#dc74bc"
-- General settings
config.check_for_updates = true
config.automatically_reload_config = true
config.exit_behavior = 'CloseOnCleanExit'
config.window_close_confirmation = 'NeverPrompt'
config.scrollback_lines = 10000
config.enable_scroll_bar = false
-- Appearance settings
config.font = wezterm.font_with_fallback({
{
family = 'FiraCode Nerd Font Med',
weight = 'Regular',
harfbuzz_features = {'calt=1', 'clig=1', 'liga=1'},
},
'Hack Nerd Font',
})
-- Background Image Configuration
--config.background = {
-- {
-- source = {
-- -- IMPORTANT: Replace this with the full path to your image file.
-- -- Use forward slashes, e.g., "C:/Users/Admin/Pictures/my-background.png"
-- File = "C:/Users/Admin/Downloads/sk.png",
-- },
-- -- Controls the transparency of the image. 0.0 is fully transparent, 1.0 is fully opaque.
-- opacity = 0.90,
-- -- Dims the image to 30% of its original brightness to make text more readable.
-- hsb = {
-- brightness = 0.1,
-- },
-- },
--}
-- Background Image Configuration (moving)
--local dimmer = { brightness = 0.040 }
--config.background = {
-- -- This is the deepest/back-most layer. It will be rendered first
-- {
-- source = {
-- File = 'C:/Users/Admin/Downloads/sk.png',
-- },
-- -- The texture tiles vertically but not horizontally.
-- -- When we repeat it, mirror it so that it appears "more seamless".
-- -- An alternative to this is to set `width = "100%"` and have
-- -- it stretch across the display
-- repeat_x = 'Mirror',
-- hsb = dimmer,
-- -- When the viewport scrolls, move this layer 10% of the number of
-- -- pixels moved by the main viewport. This makes it appear to be
-- -- further behind the text.
-- attachment = { Parallax = 0.1 },
-- },
-- -- Subsequent layers are rendered over the top of each other
-- {
-- source = {
-- File = 'C:/Users/Admin/Downloads/sk.png',
-- },
-- width = '100%',
-- repeat_x = 'NoRepeat',
--
-- -- position the spins starting at the bottom, and repeating every
-- -- two screens.
-- vertical_align = 'Bottom',
-- repeat_y_size = '200%',
-- hsb = dimmer,
--
-- -- The parallax factor is higher than the background layer, so this
-- -- one will appear to be closer when we scroll
-- attachment = { Parallax = 0.2 },
-- },
-- {
-- source = {
-- File = 'C:/Users/Admin/Downloads/sk.pngg',
-- },
-- width = '100%',
-- repeat_x = 'NoRepeat',
--
-- -- start at 10% of the screen and repeat every 2 screens
-- vertical_offset = '10%',
-- repeat_y_size = '200%',
-- hsb = dimmer,
-- attachment = { Parallax = 0.3 },
-- },
-- {
-- source = {
-- File = 'C:/Users/Admin/Downloads/sk.png',
-- },
-- width = '100%',
-- repeat_x = 'NoRepeat',
--
-- vertical_offset = '30%',
-- repeat_y_size = '200%',
-- hsb = dimmer,
-- attachment = { Parallax = 0.4 },
-- },
-- {
-- source = {
-- File = 'C:/Users/Admin/Downloads/sk.png',
-- },
-- width = '100%',
-- repeat_x = 'NoRepeat',
--
-- vertical_offset = '50%',
-- repeat_y_size = '150%',
-- hsb = dimmer,
-- attachment = { Parallax = 0.5 },
-- },
--}
config.font_size = 12.5
config.line_height = 1.0
config.cell_width = 1.0
-- -- Border Padding ===============
config.initial_cols = 70 -- Width
config.initial_rows = 24 -- Height
config.window_background_opacity = 0.95
config.text_background_opacity = 1.0
config.integrated_title_button_style = 'Windows'
config.integrated_title_button_color = 'Auto'
config.inactive_pane_hsb = {
saturation = 1.0,
brightness = 0.8,
}
-- Border Padding
config.window_padding = {
left = 15,
right = 15,
top = 0,
bottom = 10,
}
-- Adjust Window Frame
config.window_frame = {
border_left_width = '1px',
border_right_width = '1px',
border_bottom_height = '1px',
border_top_height = '1px',
border_left_color = 'rgba(165, 66, 123, 0.95)', -- Pink border (matches cursor)
border_right_color = 'rgba(165, 66, 123, 0.95)', -- Pink border (matches cursor)
border_bottom_color = 'rgba(165, 66, 123, 0.95)', -- Pink border (matches cursor)
border_top_color = 'rgba(165, 66, 123, 0.95)', -- Pink border (matches cursor)
-- Add these to preserve tab bar styling
font = wezterm.font { family = 'Hack Nerd Font', weight = 'DemiBold' },
font_size = 10.0,
-- Add color to top bar where tabs are in ===========
active_titlebar_bg = 'rgba(22, 22, 37, 0.95)', -- π 50% transparent dark purple
inactive_titlebar_bg = 'rgba(22, 22, 37, 0.95)', -- π 30% transparent dark purle
}
-- Hide the title bar
config.window_decorations = "NONE"
-- Color overrides to make text brighter and more vibrant
config.colors.foreground = '#E1E7FA' -- Brighter white text
-- Cursor color settings
-- Add to cursor settings section
config.force_reverse_video_cursor = false
config.colors.cursor_bg = '#FF79C6'
config.colors.cursor_fg = '#FFF833'
config.colors.cursor_border = '#FF1493' -- Hot pink border
--========= LEFT Tab bar (DESKTOP NAME)
config.colors.tab_bar = {
-- The overall background of the tab bar area.
background = 'rgba(22, 22, 37, 0.95)',
-- === ACTIVE TAB ===
active_tab = {
bg_color = '#dc74bc', -- The main vibrant pink
fg_color = '#171717', -- Keep dark text
intensity = 'Bold',
italic = true,
},
-- === INACTIVE TABS ===
inactive_tab = {
bg_color = '#6d2d57', -- A brighter, but still muted, dark pink
fg_color = '#a9a9a9', -- Soft, light text color
},
-- How an inactive tab looks when you hover over it.
inactive_tab_hover = {
bg_color = '#aa4c8d', -- An even brighter pink for hover feedback
fg_color = '#eaeaea', -- Fully white text on hover
italic = true,
},
-- === NEW TAB BUTTON (+) ===
new_tab = {
bg_color = 'rgba(22, 22, 37, 0.95)',
fg_color = '#dc74bc',
},
-- The new tab button hover state.
new_tab_hover = {
bg_color = '#e86dc2', -- The very bright pink for the '+' hover effect
fg_color = '#191724', -- Dark text for contrast
},
}
----------------------------------
-- Tab bar settings
config.use_fancy_tab_bar = true
config.tab_bar_at_bottom = false
config.tab_max_width = 25
config.show_tab_index_in_tab_bar = true
config.show_new_tab_button_in_tab_bar = true
config.hide_tab_bar_if_only_one_tab = false
-- Cursor settings
config.default_cursor_style = 'BlinkingBlock'
config.cursor_blink_rate = 500
config.cursor_thickness = 8
config.cursor_blink_ease_in = 'Linear'
config.cursor_blink_ease_out = 'Linear'
-- Add shadow effect (simulate glow)
--config.window_background_gradient = {
-- colors = { '#191724', '#272538', '#261924', '#1F1B1F' },
-- orientation = 'Vertical',
--}
-- Performance settings
config.front_end = 'OpenGL' -- Use WebGpu for better performance
config.webgpu_power_preference = 'HighPerformance'
config.animation_fps = 60
config.max_fps = 120
config.enable_wayland = false
config.enable_kitty_graphics = true
config.enable_csi_u_key_encoding = true
config.use_ime = true
config.adjust_window_size_when_changing_font_size = true
-- Check updates every 24 hours
config.check_for_updates = true
config.check_for_updates_interval_seconds = 86400
----------------------------------
-- launch menu with different options
config.launch_menu = {
-- WSL options
{
label = 'WSL: Home',
args = {'wsl.exe', '--cd', '/home/trinib'},
},
{
label = 'WSL: Admin',
args = {'wsl.exe'},
},
{
label = 'WSL: Code',
args = {'wsl.exe', '--cd', '~/code'},
},
{
label = 'WSL: Root',
args = {'C:\\Windows\\System32\\wsl.exe', '~'},
},
-- Windows options - these DO NOT use domain and specify args directly
{
label = 'PowerShell7: Home',
args = {"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe\\pwsh.exe", "-NoLogo"},
},
{
label = 'PowerShell7: Documents',
args = {"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe\\pwsh.exe", "-NoLogo"},
cwd = wezterm.home_dir .. '\\Documents',
},
{
label = 'PowerShell7: Downloads',
args = {"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe\\pwsh.exe", "-NoLogo"},
cwd = wezterm.home_dir .. '\\Downloads',
},
{
label = 'PowerShell7: Desktop',
args = {"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe\\pwsh.exe", "-NoLogo"},
cwd = wezterm.home_dir .. '\\Desktop',
},
{
label = 'PowerShell7: C Drive',
args = {"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.6.2.0_x64__8wekyb3d8bbwe\\pwsh.exe", "-NoLogo"},
cwd = 'C:\\',
},
{
label = 'CMD: Home',
args = {'cmd.exe'},
},
{
label = 'Git Bash: Home',
args = {'C:\\Program Files\\Git\\bin\\bash.exe', '-l'},
},
{
label = "SSH: VS",
args = {"ssh", "root@142.11.236.29"},
},
{
label = "SSH: Oracle",
args = {"ssh", "-i", "~/.ssh/oraclessh", "ubuntu@150.136.37.234"},
},
}
----------------------------------
-- Key bindings
config.disable_default_key_bindings = false
config.keys = {
-- Split panes with WSL and send a clear command immediately after
{ key = '}', mods = 'CTRL|SHIFT', action = wezterm.action_callback(function(window, pane)
-- First split the pane
window:perform_action(
act.SplitPane {
direction = 'Right',
command = { args = {'wsl.exe', '--cd', '/home/trinib'}, },
},
pane
)
-- Wait a moment for the pane to initialize
wezterm.sleep_ms(100)
-- Send the clear command
window:active_pane():send_text("clear\n")
end)},
-- Split panes down
{ key = '"', mods = 'CTRL|SHIFT', action = wezterm.action_callback(function(window, pane)
-- First split the pane
window:perform_action(
act.SplitPane {
direction = 'Down',
command = { args = {'wsl.exe', '--cd', '/home/trinib'}, },
},
pane
)
-- Wait a moment for the pane to initialize
wezterm.sleep_ms(100)
-- Send the clear command
window:active_pane():send_text("clear\n")
end)},
-- Close current pane
{ key = 'x', mods = 'CTRL|SHIFT', action = act.CloseCurrentPane { confirm = false } },
-- Navigate between panes
{ key = 'LeftArrow', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Left' },
{ key = 'RightArrow', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Right' },
{ key = 'UpArrow', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Up' },
{ key = 'DownArrow', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Down' },
-- Resize panes
{ key = 'LeftArrow', mods = 'CTRL|SHIFT|ALT', action = act.AdjustPaneSize { 'Left', 5 } },
{ key = 'RightArrow', mods = 'CTRL|SHIFT|ALT', action = act.AdjustPaneSize { 'Right', 5 } },
{ key = 'UpArrow', mods = 'CTRL|SHIFT|ALT', action = act.AdjustPaneSize { 'Up', 5 } },
{ key = 'DownArrow', mods = 'CTRL|SHIFT|ALT', action = act.AdjustPaneSize { 'Down', 5 } },
-- Tabs with WSL
{ key = 't', mods = 'CTRL', action = act.SpawnCommandInNewTab { args = {'wsl.exe'} } },
{ key = 'w', mods = 'CTRL', action = act.CloseCurrentTab { confirm = false } },
-- Font size
{ key = '0', mods = 'CTRL', action = act.ResetFontSize },
{ key = '+', mods = 'CTRL', action = act.IncreaseFontSize },
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
-- Clipboard
{ key = 'c', mods = 'CTRL|SHIFT', action = act.CopyTo 'Clipboard' },
{ key = 'v', mods = 'CTRL|SHIFT', action = act.PasteFrom 'Clipboard' },
-- Quick select mode
{ key = 's', mods = 'CTRL|SHIFT', action = act.Search { CaseSensitiveString = '' } },
-- Launcher menu
{ key = 'l', mods = 'CTRL|SHIFT', action = act.ShowLauncherArgs { flags = 'FUZZY|LAUNCH_MENU_ITEMS' } },
-- WINDOW CONTROL SHORTCUTS
{ key = 'q', mods = 'CTRL|SHIFT', action = act.QuitApplication },
{ key = 'm', mods = 'CTRL|SHIFT', action = act.Hide },
{ key = 'f', mods = 'CTRL|SHIFT', action = wezterm.action.ToggleFullScreen },
-- Run the 'fish' command with Ctrl+E
{
key = 'e',
mods = 'CTRL',
action = wezterm.action.SendString 'exec zsh\n',
},
-- Animated Background Opacity Toggle
{ key = 'o', mods = 'CTRL|SHIFT', action = wezterm.action_callback(function(window, pane)
local overrides = window:get_config_overrides() or {}
if not overrides.window_background_opacity then
overrides.window_background_opacity = 0.7
else
if overrides.window_background_opacity == 0.7 then
overrides.window_background_opacity = 0.94
else
overrides.window_background_opacity = 0.7
end
end
window:set_config_overrides(overrides)
end)},
--Quick Directory Jumper
{ key = '1', mods = 'CTRL|ALT', action = act.SpawnCommandInNewTab {
args = {'wsl.exe', '--cd', '/home/trinib/projects'}
}},
{ key = '2', mods = 'CTRL|ALT', action = act.SpawnCommandInNewTab {
args = {"C:\\Program Files\\PowerShell\\7\\pwsh.exe", "-NoLogo"}
}},
-- Add these for Chrome-like tab switching
{ key = 'Tab', mods = 'CTRL', action = act.ActivateTabRelative(1) },
{ key = 'Tab', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
-- Jump to specific tabs
{ key = '1', mods = 'ALT', action = act.ActivateTab(0) },
{ key = '2', mods = 'ALT', action = act.ActivateTab(1) },
{ key = '3', mods = 'ALT', action = act.ActivateTab(2) },
{ key = '4', mods = 'ALT', action = act.ActivateTab(3) },
-- Tab Move/Reorder
{ key = '{', mods = 'CTRL|SHIFT', action = act.MoveTabRelative(-1) },
{ key = '}', mods = 'SHIFT|ALT', action = act.MoveTabRelative(1) },
--Better Scrolling
{ key = 'k', mods = 'CTRL|SHIFT', action = act.ScrollByPage(-0.5) },
{ key = 'j', mods = 'CTRL|SHIFT', action = act.ScrollByPage(0.5) },
{ key = 'PageUp', mods = 'SHIFT', action = act.ScrollByPage(-1) },
{ key = 'PageDown', mods = 'SHIFT', action = act.ScrollByPage(1) },
--Rename Current Tab
{ key = 'r', mods = 'CTRL|SHIFT', action = act.PromptInputLine {
description = 'Enter new name for tab',
action = wezterm.action_callback(function(window, pane, line)
if line then
window:active_tab():set_title(line)
end
end),
}},
}
----------------------------------
-- Mouse bindings
config.mouse_bindings = {
-- Right click paste
{
event = { Down = { streak = 1, button = 'Right' } },
mods = 'NONE',
action = act.PasteFrom 'Clipboard',
},
-- Select text with double-click
{
event = { Down = { streak = 2, button = 'Left' } },
mods = 'NONE',
action = act.SelectTextAtMouseCursor 'Word',
},
-- Select line with triple-click
{
event = { Down = { streak = 3, button = 'Left' } },
mods = 'NONE',
action = act.SelectTextAtMouseCursor 'Line',
},
}
----------------------------------
-- Disable confirmation for tab close button
wezterm.on('mux-is-process-stateful', function(domain, pane)
-- Always return false to indicate no confirmation needed
return false
end)
----------------------------------
-- Override the new tab button behavior to open WSL
--wezterm.on('format-tab-title', function(tab, tabs, panes, config, hover, max_width)
-- -- This ensures the tab title is formatted correctly
-- return tab.active_pane.title
--end)
----------------------------------------------------------
-- Show icon and name on tabs
--wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
-- local process_name = tab.active_pane.foreground_process_name or ""
-- local icon, text, icon_color
--
-- -- Match based on process name (case-insensitive)
-- if process_name:match("wsl") then
-- icon = "π§"
-- text = "WSL"
-- icon_color = "#7ECF17" -- green
-- elseif process_name:match("powershell") or process_name:match("pwsh") then
-- icon = "β‘"
-- text = "PowerShell"
-- icon_color = "#FFB86C" -- orange
-- elseif process_name:match("bash") then
-- icon = "π"
-- text = "Bash"
-- icon_color = "#8BE9FD" -- cyan
-- elseif process_name:match("cmd") then
-- icon = "π»"
-- text = "CMD"
-- icon_color = "#F1FA8C" -- yellow
-- else
-- icon = "π»"
-- text = "Shell"
-- icon_color = "#BD93F9" -- purple fallback
-- end
--
-- -- Tab colors
-- local bg, fg
-- if tab.is_active then
-- bg, fg = "#ff79c6", "#000000" -- active tab background/text
-- elseif hover then
-- bg, fg = "#bd93f9", "#ffffff" -- hovered tab
-- else
-- bg, fg = "#44475a", "#bfbfbf" -- inactive tab
-- end
--
-- return {
-- { Background = { Color = bg } },
-- { Foreground = { Color = icon_color } },
-- { Text = " " .. icon .. " " },
-- { Foreground = { Color = fg } },
-- { Text = text .. " " },
-- }
--end)
-----------------------------------------------------------------
-- Show icons and path on tabs
wezterm.on("format-tab-title", function(tab, tabs, panes, config, hover, max_width)
local process_name = tab.active_pane.foreground_process_name or ""
local cwd_uri = tab.active_pane.current_working_dir
local cwd = ""
-- Extract folder name from URI (e.g. file:///home/user/project)
if cwd_uri then
cwd = cwd_uri.file_path or cwd_uri
cwd = cwd:gsub("file://", "")
cwd = cwd:gsub("%%20", " ") -- decode spaces
local home = os.getenv("HOME") or os.getenv("USERPROFILE")
if home and cwd:find(home, 1, true) then
cwd = cwd:gsub(home, "~") -- shorten home dir
end
-- Show only last folder name
cwd = cwd:match("([^/\\]+)$") or cwd
else
cwd = "π"
end
----------------------------------
-- Determine icon and color based on process
--Terminal / Shell Generic (copy and past in terminal to view)
-- ξ ο ο σ° σ° σ°· σ°¦ͺ σ°¨ σ°© σ°
ο
-- | Shell | Icon |
-- | ------------- | ----- |
-- | Bash | ξ― |
-- | Zsh | σ± |
-- | Fish | σ°Ί |
-- | Nushell | σ°― |
-- | PowerShell | σ°¨ |
-- | CMD | ξ― |
-- | Korn / POSIX | ο |
-- | Shell Unknown | ο / ξ |
--
-- | OS | Icon |
-- | ------------- | ----- |
-- | Windows | ο
Ί / ξ |
-- | macOS | ο£Ώ |
-- | Generic Linux | ο |
-- | Red Hat | ο |
-- | Ubuntu | ο / ο |
-- | Debian | ο |
-- | Arch | ο |
-- | Fedora | ο |
-- | Alpine Linux | ο |
-- | Kali Linux | ο§ |
-- | Manjaro | ο |
-- | CentOS | ο |
-- | OpenSUSE | ο |
-- | Gentoo | ο |
-- | NixOS | ο |
-- | BSD (Generic) | ο / ο |
-- | Android Shell | ο
» |
--
-- | Tool | Icon |
-- | -------------------- | ---- |
-- | Git Repo | ξ₯ |
-- | Git Branch | ο |
-- | Git Commit | ο |
-- | Code Workstation | ο¦ |
-- | Editor Terminal Mode | σ°
© |
-- | Debug Shell | ο |
-- | Python Venv | ξ΅ |
-- | Node CLI | ξ |
-- | Rust CLI | ξ¨ |
-- | Go CLI | ξ§ |
--
-- | Context | Icon |
-- | ------------ | ---- |
-- | Docker | ξ |
-- | Kubernetes | σ±’ |
-- | AWS CLI | ξ° |
-- | Azure Shell | ο΄± |
-- | Google Cloud | ξ² |
-- | Remote SSH | σ°£ |
-- | VPN Tunnel | σ°₯ |
-- | VM Guest | σ°’Ή |
--
-- | Meaning | Icon |
-- | ------------------- | ---- |
-- | Root user / SU mode | ο |
-- | Sudo Available | σ°― |
-- | Elevated Shell | ο³ |
-- | Chroot | σ°±
|
-- | Virtual Environment | ο |
-- | Script Execution | ξ’ |
-- | System Monitor | ο³ |
--
-- | Context | Icon |
-- | --------------- | ----- |
-- | Home Directory | ο / ο |
-- | Git Repo Folder | ο |
-- | Media Folder | ο
|
-- | Network Folder | σ°· |
local icon, icon_color
if process_name:match("wsl") then
icon = "ο" -- Linux Tux icon
icon_color = "#4AFF67"
elseif process_name:match("powershell") or process_name:match("pwsh") then
icon = "ο" -- Powershell Nerd Font icon
icon_color = "#FFB86C"
elseif process_name:match("bash") then
icon = "ξ―" -- Bash shell Nerd Font icon
icon_color = "#8BE9FD"
elseif process_name:match("cmd") then
icon = "ξ―" -- Command prompt Nerd Font icon
icon_color = "#D0D400"
else
icon = "ο " -- Generic terminal
icon_color = "#6363FF"
end
-- Background color of tabs π
local bg, fg
if tab.is_active then
bg, fg = "#ff79c6", "#000000"
elseif hover then
bg, fg = "#bd93f9", "#ffffff"
else
bg, fg = "#612E4A", "#bfbfbf"
end
-- Build final title
return {
{ Background = { Color = bg } },
{ Foreground = { Color = icon_color } },
{ Text = " " .. icon .. " " },
{ Foreground = { Color = fg } },
{ Text = cwd .. " " },
}
end)
----------------------------------
-- Make the new tab button spawn WSL tabs on left click, show launcher on right click
wezterm.on('new-tab-button-click', function(window, pane, button, default_action)
-- Check which mouse button was clicked
if button == "Left" then
-- Left click: spawn a WSL tab
window:perform_action(
act.SpawnCommandInNewTab { args = {'wsl.exe', '--cd', '/home/trinib'} },
pane
)
return false -- prevent the default action
end
end)
----------------------------------
-- π Gradient trail at top
local gradient_colors = {
"#ff5555", "#ff79c6", "#bd93f9", "#50fa7b", "#f1fa8c", "#ffb86c", "#7989FF"
}
-- How fast to animate (seconds)
local frame_delay = 0.3 -- 20fps (lower = smoother, higher CPU)
local window_ref = nil
local function update_status()
if not window_ref then return end
local window = window_ref
local hostname = wezterm.hostname()
-- π Build gradient trail
local trail = {}
for _, c in ipairs(gradient_colors) do
table.insert(trail, { Foreground = { Color = c } })
table.insert(trail, { Text = "β" })
end
-- Rotate colors
table.insert(gradient_colors, 1, table.remove(gradient_colors))
-- π§ Compose right-status
local status = {
{ Foreground = { Color = '#b7f070' } },
{ Text = ' ' .. hostname .. ' ' },
}
for _, item in ipairs(trail) do
table.insert(status, item)
end
window:set_right_status(wezterm.format(status))
-- π Schedule next frame
wezterm.time.call_after(frame_delay, update_status)
end
wezterm.on("update-right-status", function(window, _)
if not window_ref then
window_ref = window
wezterm.time.call_after(frame_delay, update_status)
end
end)
----------------------------
-- π Visual Bell (Silent Pink Flash)
config.visual_bell = {
fade_in_duration_ms = 250,
fade_out_duration_ms = 350,
target = "BackgroundColor",
}
config.colors.visual_bell = "#7A3A5A" -- bright pink flash
config.audible_bell = "Disabled" -- π« no sound
----------------------------------------------------------
-- Return the configuration
return config