Notes on Miscellaneous stuff

Last updated on 2 June 2026
20:34, 06 March 2026

Me: Can VSCode terminal with an ongoing session be made a separate window in Windows 11
GSAI (Google Search AI): ...
Method 3: Command Palette
Open the terminal (Ctrl+`).
Press Ctrl+Shift+P to open the Command Palette.
Type and select: Terminal: Move Terminal into New Window. 
...

Me: Command Palette method worked. Drag and Drop did not work, and Context menu command did not show Move Terminal into Editor Area.
...

GSAI said that two terminals are needed for one or both of above methods to work.
Confirmed that with two terminals open, I could drag one of the terminal icons on right sidebar onto editor which moved it to an editor tab. Then I could use context menu on tab to move it to a separate (floating) terminal.
------
===================
14:41, 10 March 2026

Me (on Google Search): VScode temporarily turn off tooltips while typing

GSAI (Edited): To temporarily turn off or delay tooltips while typing in Visual Studio Code, you can 

1. Disable Hover Tooltips
  • Via Settings UI: Go to File > Preferences > Settings (or press Ctrl+,), search for "Hover", and uncheck "Editor > Hover: Enabled".
2. Adjust Suggestion Delay
  • Quick Suggestions Delay: Search for editor.quickSuggestionsDelay and increase the value 
  • Hover Delay: Search for editor.hover.delay and increase it 
4. Toggle via Keyboard (Temporary Hide) 
  • Press Escape to dismiss the current tooltip or suggestion box.
  • Press Ctrl + Space again to toggle the details pane of a suggestion. 
...

[I increased Delay to 1300 from 300. That's working out well. It has a reset to go back to default of 300.]
==========

In VSCode: Ctrl+PgDn to move to next editor tab .. Ctrl+PgUp - prev
=========

Me to GS: vscode, keyboard shortcut for next match while focus is on text in file in tab but find popup is active and shows up and down buttons

GSAI (Edited): When the Find widget is active but your focus is in the editor text:

* Find Next: Press F3 (Windows/Linux) to jump to the subsequent match.
* Find Previous: Press Shift + F3 (Windows/Linux) to jump back to the previous match. 
...

[F3 worked for me.]
===============

17:09, 19 March 2026

Me: I want Chrome light mode on laptop and dark mode on PC

GSAI (Google Search AI): To use different themes on your laptop and PC while using the same Google account, you must first disable Theme Sync. By default, Chrome syncs your appearance settings across all devices. 

1. Disable Theme Syncing 
Perform these steps on both your laptop and your PC to ensure they don't overwrite each other:
Open Chrome and click the three-dot menu (top-right) -> Settings.
Select You and Google from the left sidebar.
Click Sync and Google services.
Select Manage what you sync.
Choose Customize sync and toggle Themes to OFF. 

2. Set Your Preferred Modes
Now that syncing is disabled, you can set the modes independently: 
...
---------

I have disabled theme syncing. Need to now see if I can have light mode on laptop and dark mode on Chrome. [Earlier the setting was 'Sync everything'. So me choosing light mode on laptop Chrome changed desktop Chrome also to light mode from dark mode.]

Did the same for Extensions (disable sync for it).
...

As per GSAI, my gmail theme setting is also shared when Chrome theme is shared.
===================

https://bloggerfeedtobook.netlify.app/ when used with DarkReader On mode (dark mode), adds darkreader CSS stuff into output file. In DarkReader Off (light mode), it does not add such stuff (only what post itself contains is retained).
20260319-raviswdev-L4-dark.html - 714 KB
20260319-raviswdev-L4-light.html - 695 KB
This is not surprising as https://bloggerfeedtobook.netlify.app/ renders the output on browser which is then saved as file.
--------------------

1 April 2026 Note: This is a Gemini provided summary of a chat I had with it today.

Technical Deep Dive: WebSockets vs. REST in the Real World

This discussion explored the conceptual and practical differences between traditional REST APIs and WebSockets, using a popular overview video as a starting point.

Core Resource

Key Discussion Points

  • The "Listener" Concept: We identified that while the video focuses on a binary choice, there is a middle ground. Technologies like Server-Sent Events (SSE) allow an app to register a "listener" to receive server updates without the full complexity of a two-way WebSocket.
  • 4G Jitter & Stability: A critical part of the conversation focused on why stateful WebSockets can be "brittle" on 4G connections. Because WebSockets maintain a persistent "pipe," network jitter (timing variations) can snap the connection, requiring complex re-handshaking logic.
  • The WhatsApp vs. Gemini Live Paradox: *WhatsApp succeeds on rural 4G because it uses highly optimized, lightweight protocols (like MQTT) over its connection, designed to silently reconnect and buffer small text packets.
    • Gemini Live often struggles or fails on the same connection because it streams heavy, high-frequency multimodal data (audio/video). This requires near-zero latency; when jitter occurs, the stream breaks because it cannot "wait" to catch up like a text message can.
  • Duplex Terminology: We clarified that while WebSockets are Full-Duplex, REST is best described as Request-Response. REST isn't strictly "half-duplex" (like a walkie-talkie), but it is restricted by the rule that the client must always initiate the conversation.

Summary Table

Feature REST API WebSockets
Model Request-Response Full-Duplex (Two-way)
State Stateless (Each request is new)   Stateful (Continuous connection)
4G Performance   Resilient but "Laggy" Fast but sensitive to Jitter
Best For Standard data fetching Real-time Chat, Gaming, Streaming

------------------------------

12:41, 08 April 2026

For bookmarks in .md file, Breakpoints workaround in VS Code does not work.
However, Outline view helps to jump to header lines.

If more than that is needed, Bookmarks extension, https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks should be used.
Note: The extension has Labeled Bookmarks (Ctrl+Alt+Shift+K) to give markers specific names. These names will then show up in the Bookmarks Side Bar, essentially allowing you to create your own "Custom Outline" that exists alongside the native one.
------------------------------
20 Apr 2026

------------------------------
18 Apr 2026

Workaround for Replace During File Copy in Win 11 Being Destructive

The Core Issue

  • Choosing "Replace" during a file copy or move operation in Windows 11 is a destructive action.
  • The original file in the destination is overwritten directly and is not sent to the Recycle Bin.
  • A "brain fade" or a physical mouse slip (dragging an older file onto a newer one) results in the immediate and permanent loss of the updated version.

The Proposed Workaround

  • Step 1: Using Windows File Explorer, delete the file in the destination folder first. This ensures it is safely stored in the Recycle Bin.
  • Step 2: Copy or move the source file into the now-empty destination.
  • Safety Net: If the wrong file is deleted or the copy direction is reversed, the deleted file remains fully recoverable from the Recycle Bin.

Superiority Over the "Compare Info" Dialog

  • Reduced Cognitive Load: The "Compare info" dialog of "Replace or Skip Files" confirmation dialog is visually dense and requires the user to analyze timestamps and file sizes under pressure.
  • Fault Tolerance: Users often suffer from "dialog fatigue" and may click "Replace" on autopilot. The manual deletion method replaces complex decision-making with a simple, fail-safe mechanical habit.

Superiority Over PowerShell or Automation

  • Zero Friction: A PowerShell script requires either opening a terminal or performing complex Registry edits to integrate with the Windows Explorer context menu.
  • Ad-Hoc Efficiency: For spontaneous, one-off file management, the "Delete then Copy" method is faster and requires no technical setup, keeping the workflow entirely within the native user interface.
----------
10 May 2026

Resolving the "Device is being used" Error During USB SSD Ejection

The Issue: Following a large file transfer or backup operation, Windows may refuse to unmount the USB SSD using the "Safely Remove Hardware" feature, displaying a "device is being used" error. This is typically caused by background system services, such as Windows Defender, scanning the newly written data.

The Solution: Do not forcefully unplug the drive while the system is running. Instead, follow these steps:

  1. Close any open terminal windows or file explorers.
  2. Initiate a standard Windows Shut down.
  3. Wait for the computer to completely power off.
  4. Safely unplug the USB SSD.

Why Shutdown Guarantees Data Safety: A full system shutdown is entirely safe and ensures no data corruption occurs, even if write caching is enabled. During the shutdown sequence, the Windows operating system performs the following actions:

  • Forces Cache Flushing: Windows explicitly commands all connected storage controllers to flush their write caches.
  • Delays Power-Off: The operating system actively halts the final power-down until it receives confirmation from the USB SSD that all pending data in the cache has been successfully committed to the physical flash memory.
  • Terminates Locks: Shutting down terminates all background services and security scans that were holding an active lock on the drive.

Therefore, once the machine is fully powered off, it is guaranteed that all data has been written and the drive is perfectly safe to physically disconnect.


Understanding Windows Defender Drive Locking and File Systems

The File Hash Cache and Interrupted Scans Windows Defender utilizes a File Hash Cache to optimize scanning speeds. When a new file is encountered, the anti-virus engine calculates a unique mathematical hash of that file's contents, scans it for threats, and records the hash in its internal database as "safe."

If a bulk copy operation (e.g., 10,000 files) is performed and the system is subsequently shut down to release the drive lock, Windows Defender may have only had time to hash and verify a fraction of those files (e.g., 2,000). When that USB drive is mounted again at a later date, Defender recognizes that 8,000 files are still unverified. Even if no new write operations are initiated by the user, Defender will immediately resume scanning the remaining files in the background. This background process will lock the drive and prevent a clean ejection until the engine has successfully hashed the remaining 8,000 items.

File System Impact: NTFS vs. exFAT The speed at which Windows Defender identifies which files are "old" and which are "new" depends entirely on the drive's file system format.

  • NTFS (Standard Hard Drives, e.g., WD My Passport): NTFS is a journaled file system. By default, WD My Passport drives are pre-formatted as NTFS, making them ready to use immediately for Windows 10/11. This file system maintains a hidden database called the Update Sequence Number (USN) Journal, which keeps a strict, instant ledger of every single modification made to the drive. When an NTFS drive is connected, Windows Defender queries the USN Journal directly. The journal immediately reports exactly which files have been added or changed since the last connection. Defender skips the old files entirely and only scans the new ones, resulting in a very rapid lock-release.
  • exFAT / FAT32 (Standard USB Flash Drives and External SSDs): These file systems lack a USN Journal. When an exFAT drive is connected, Windows has no centralized ledger to query. To determine what is new, Windows Defender must manually traverse the entire directory tree, checking the file headers and timestamps of every single file against its cache. For a drive containing hundreds of thousands of files, this enumeration process requires significant USB bandwidth and time, causing the drive to remain locked for 10 to 20 minutes just to determine that nothing has changed.

Windows Search Indexing and Drive Locking

The Search Indexer Lock In addition to anti-virus software, the Windows Search Indexer (SearchIndexer.exe) is another primary background process that can prevent a USB drive from cleanly unmounting. When a drive is connected or a large volume of new files is copied to it, the indexer automatically crawls the directory tree to catalog text and metadata for faster Start Menu and File Explorer searches. While this crawling process occurs, the indexer holds an active lock on the drive, resulting in a "device is being used" error upon attempted ejection.

Global vs. Drive-Specific Indexing For systems where Windows Search Indexing has been entirely disabled at the operating system level (e.g., via the services.msc console), this specific locking mechanism is not an issue, and the indexer will not interfere with drive removal.

However, if the global indexing service remains active, it can be disabled for a specific USB drive to prevent future locking. This ensures the backup destination is ignored by the indexer without affecting the search performance of the main operating system drive.

How to Disable Indexing for a Specific Drive:

  1. Open Windows File Explorer and navigate to This PC.
  2. Right-click the target USB drive and select Properties.
  3. At the bottom of the General tab, clear the checkbox labeled: "Allow files on this drive to have contents indexed in addition to file properties."
  4. Click Apply.
  5. When prompted, select the option to apply the changes to the drive, subfolders, and files, and click OK. (This process may take a few moments depending on the number of files currently on the drive).


14:15, 17 May 2026

I disabled Dependabot alerts for my gita repo to avoid Dependabot alerts. Related Gem exchanges ...

Me: ... Background is that one unused old branch in my repo uses old Next.js version which has security vulnerability. I don't have time to update that old unused branch only to avoid GitHub security alert emails.
...

Me: Now I presume that I cannot disable/enable Depandabot alerts for a branch in my repo. am I right? I mean, it is at repo level and not branch level.

Gem: You are completely right. Dependabot alerts operate strictly at the **repository level**, not the branch level. GitHub scans the configuration files (like `package.json` or `package-lock.json`) across *all* branches in the repository, and there is no built-in toggle to tell Dependabot to "ignore this specific branch."

Since you've already turned off Dependabot alerts globally for this repo, you are completely safe from those emails.

However, if you ever want to turn Dependabot alerts back on for your main development work without that old branch triggering a flood of warnings, you have two practical choices to isolate it:

Option 1: The Quickest Fix (Delete the branch if unneeded)

If that old branch is truly just a snapshot of history that you don't intend to merge or work on again, the cleanest approach is to delete it from GitHub. You can always keep a local copy on your machine for archiving purposes. Once deleted from GitHub, it stops being scanned.

Option 2: Target the package files on that branch

If you absolutely must keep the branch on GitHub, you can render it invisible to Dependabot with a tiny tweak:

1. Switch to that old branch.
2. Rename or delete the package manifest files (e.g., rename `package.json` to `_package.json.bak`).
3. Commit and push the change.

Without a recognizable `package.json` or lockfile on that branch, GitHub's Dependency graph won't find anything to scan there, effectively solving the problem for that branch alone while letting you use Dependabot normally on your active branches.

Me: Option 2 of renaming `package.json` to `_package.json.bak` in that old branch is a great suggestion as it will be very simple to do. I will consider doing that later on. After that I can reenable Dependabot alerts for this gita repo. Thanks a ton.

--- end chat exchanges ---

UI to access Depandabot alerts enable/disable setting:
Repo settings -> Left Sidebar -> Advanced Security -> Depandabot alerts

Also Gem said, "... you do not need to disable the Dependency graph. Leaving it enabled won't trigger the emails you are trying to avoid." So I have left Dependency graph enabled.

=================

00:22, 20 May 2026

How To Create Custom VSCode Snippets, https://www.youtube.com/watch?v=TGh2NpCIDlc, 9 min. 20 secs, Mar. 2022 by Web Dev Simplified
LHS Gear icon -> Snippets -> New Global Snippets file

To see currently available snippets:
Command Palette -> Insert Snippet

To delete a custom snippet (aka user snippet) file in VS Code, open it via LHS Gear icon -> Snippets, right-click its editor tab, select "Reveal in File Explorer," and delete the underlying file directly from your system.

10 Essential Keyboard Shortcuts For Programmer, https://www.youtube.com/watch?v=GmdN0kQ2rIs, 11 min. 13 secs, Nov. 2018 by Web Dev Simplified
From its Desc:
[0:00] - Introduction
01. [01:45] - (Ctrl + C) Copy/(Ctrl + X) Cut/(Ctrl + V) Paste Whole Lines
02. [02:44] - (Ctrl + /) Toggle Comment on Highlighted Lines
03. [03:29] - (Ctrl + P) Open File Within Project By Name
04. [04:00] - (Ctrl + F) Find In File, (Ctrl + Shift + F) Find In Project
05. [04:51] - (Tab) Indent Highlighted Lines, (Shift + Tab) Unindent Highlighted Lines
06. [05:20] - (Ctrl + N) Create New File
07. [05:36] - (Ctrl + Enter) [Ravi: This seems to be taken up by AI tool now.] Create New Line Below Current Line Independent of Cursor Position
08. [06:10] - (Ctrl + Left/Right Arrow) Move Cursor Whole Words At A Time [Ravi: Ctrl+BackSpace deletes previous word, Ctrl+Delete deletes next word].
09. [06:45] - (Shift + Left/Right Arrow) Highlight Characters With Arrow Keys
10. [07:04] - (Ctrl + S) Save File, (Ctrl + A) Select All, (Ctrl + Z) Undo, (Ctrl + Shift + Z)/(Ctrl + Y) Redo
----

10 Best VSCode Keyboard Shortcuts, https://www.youtube.com/watch?v=YgI5GEZzrIo, 1 min, Feb. 2022, by Web Dev Simplified
 Alt + mouseclick on multiple lines (col pos can be different for each line) selects multiple lines for insert. Typed content is replicated across multiple lines. Esc to break out of multiple line insert.
-------

20 May 2026

=========

29 May 2026

My (User) Snippets in VSCode as of 13:00, 29 May 2026

"Inserted Line Breaks Message": {
"scope": "markdown",
"prefix": "ilb",
"body": [
"*(Inserted line breaks below to prevent horizontal scroll issue.)*"
],
"description": "Message: Inserted line breaks to prevent horizontal scroll issue"
},
"MDLTitle": {
"scope": "markdown",
"prefix": "mdl",
"body": [
"# MDL - Content copied to blog post\n\n$1\n\n---\n"
],
"description": "Add MDL - Content copied Title"
},
"Snipped": {
"scope": "", // All languages
"prefix": "---",
"body": [
"---snipped---"
],
"description": "Adds snipped entry"
}
--- end User Snippets code ---

But these user snippets needed to be typed fully, followed by Ctrl + Space to show dropdown with this entry being first and auto-selected, followed by Enter, to get the expanded code. Only typing the snippet followed by tab was neither showing dropdown nor expanding snippet. I discussed the issue with Gemini Code Assist (GCA). With its help I got below solution for two of the above snippets. The --- snippet seems to be treated differently due to special characters in it.

VSCode: To get MDL and ilb to expand on tab
Settings -> (type) tab completion
Editor: Tab Completion was off -> Turned it to On.

With the above, typing the snippet followed by tab gives the expanded snippet. The (suggestions) dropdown is not shown but that's not a big issue for me.
I asked GCA about any downside for above. It said:

... The reason comes down to one major downside: The "Tab Key Hijack" (Accidental Expansions).

In a text editor, the Tab key's primary, historical job is indentation and alignment.

When you turn "editor.tabCompletion": "on", you are giving VS Code permission to hijack the Tab key whenever your cursor happens to be at the end of a word that matches a snippet prefix.

The Downside in Action

Imagine you have a snippet with the prefix for that expands into a massive for-loop block. Now, imagine you are writing some comments or formatting some code, and you type the word "for", followed by a desire to insert a big space to align the next word:

// We are doing this for[Press Tab to align]

If Tab Completion is OFF (the default):

You press Tab, and it inserts a normal tab space. (Safe and predictable).

If Tab Completion is ON:

You press Tab, and instead of getting a space, your comment suddenly explodes into a 5-line
 for (let i = 0; i < array.length; i++) { ... }
block of code!

Because Tab Completion works in the background without showing you a visual menu first, it can feel like the editor is behaving unpredictably if you forget exactly which prefixes you have registered.

Why VS Code Defaults to "Off"

VS Code's design philosophy is Predictability. By defaulting to off, the editor guarantees that Tab will always insert whitespace, unless the IntelliSense dropdown menu is visibly open on your screen. The dropdown menu acts as a visual safety confirmation: "Hey, if you press Tab right now, I'm going to expand this code. If you don't see this menu, you are safe to indent."

The "Middle Ground" Setting

If you ever find that Tab Completion is getting in your way or expanding things accidentally when you just want to indent, you can try changing the setting to:

"editor.tabCompletion": "onlySnippets"

This is a slightly safer version of "on". It strictly limits the background tab expansion to only your explicitly defined snippets, rather than trying to expand general words or Emmet abbreviations.
--- end GCA response ---

I then set "editor.tabCompletion": "onlySnippets".
That is working well. In fact, even --- followed by tab is getting expanded now!
===========

1 Jun 2026

Quick Reference: Untrack a File and Add to Gitignore

To stop Git from tracking a file without deleting it from your local machine, run git rm --cached <file-path> to clear it from Git's memory index. This forces the file's status back to "Untracked" (marked as U in VS Code). Next, simply add the file path to your .gitignore file and commit the changes to ensure Git ignores all future modifications globally across the repository. (Provided by Google Search AI).

=========

Me: Can I easily add a command to VS Code that opens a specific file on my PC? That's all I need.

GSAI: Yes, you can do this natively by adding a custom keyboard shortcut to your global user settings file. You do not need any extensions. VS Code has a built-in command called vscode.open that can target any specific file path on your computer.

Step-by-Step Setup

1. Press Ctrl + Shift + P (or Cmd + Shift + P on Mac) to open the Command Palette.
2. Type and select Preferences: Open Keyboard Shortcuts (JSON).
   (Ravi: Use the entire string above including the JSON bit, otherwise it opens the massive, confusing default keybindings list).
3. Paste the following configuration snippet inside the square brackets []:

{
  "key": "ctrl+alt+n",
  "command": "vscode.open",
  "args": "file:///C:/Users/{username}/CurrProj/Common/VSCode-MyCheatSheet.txt"
}

Important Formatting Rules

* The Path Prefix: Local Windows paths must be prefixed with file:/// so VS Code recognizes them as local hard drive resources.
* Use Forward Slashes: Windows users must change backslashes (\) to forward slashes (/) inside the JSON file to avoid format syntax errors.
* Choose Your Shortcut: Change "key": "ctrl+alt+n" to whatever unassigned key combination you prefer.

Once you save the file, pressing your chosen keys inside any active project will instantly open your quick-reference note in a new tab.

(Ravi: The above procedure worked for me.)

Me: Interesting! Can I easily find which shortcut keys are currently free in VS Code

GSAI: Yes! VS Code has a dedicated built-in tool that checks exactly which combinations are free by letting you record keys in "Keyboard Detector" mode. [1] 

Instead of scrolling through thousands of commands, you can explicitly test any combination you have in mind to see if it is taken or free: [1, 2, 3] 

The 10-Second Free-Key Check

1. Open the Keyboard Shortcuts panel by pressing Ctrl + K immediately followed by Ctrl + S (or Cmd + K, Cmd + S on Mac).
2. Click the small keyboard icon on the far right edge of the top search bar (or press Alt + K / Cmd + K).
3. The search bar will change to say "Clear Search Results" and enter recording mode.
4. Press the exact key combo you want to use (e.g., Ctrl + Alt + N). [4, 5] 

How to Read the Results

* If the screen goes totally blank: Congratulations! That shortcut is 100% free and completely safe to use.
* If a command pops up in the list: The shortcut is already bound to that feature. [5] 

Tip: If a shortcut is assigned to a feature you never use, you can still steal it! Simply right-click that feature in the menu and select Remove Keybinding to instantly free it up.

What shortcut combination are you thinking of assigning to your reference note? If you are stuck, keys using Ctrl + Alt + [letter] or multi-chord sequences (like pressing Ctrl + K then N) are almost always completely unassigned!

[1] [https://code.visualstudio.com](https://code.visualstudio.com/docs/configure/keybindings)
[2] [https://medium.com](https://medium.com/@dimterion/vs-code-shortcuts-tips-ace78b45ed58)
[3] [https://www.reddit.com](https://www.reddit.com/r/vscode/comments/179znc9/where_can_i_find_a_list_of_all_vscode_features/)
[4] [https://code.visualstudio.com](https://code.visualstudio.com/docs/getstarted/personalize-vscode)
[5] [https://code.visualstudio.com](https://code.visualstudio.com/docs/configure/keybindings)
=============

Comments