Trying to open file from terminal is throwing error

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Getting below error when opening file through commands: cursor file.txt
SyntaxError: Invalid regular expression flags
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:117:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:361:14)
at async link (node:internal/modules/esm/module_job:70:21)

Node.js v17.9.1

Steps to Reproduce

$ cursor .
file:///home/ganeshbp/.local/share/cursor-agent/versions/2025.09.17-25b418f/index.js:812
).join(a)}).filter(Boolean).join(a)}if(e.internal_accessibility){let{role:a,state:i}=e.internal_accessibility;if(i){let r=Object.keys(i).filter((o)=>i[o]).join(", ");if(r)t=(${r}) ${t}}if(a&&a!==n.parentRole)t=${a}: ${t}}return t},c3n=(e,n,t)=>{let{offsetX:a=0,offsetY:i=0,transformers:c=[],skipStaticElements:r}=t;if(r&&e.internal_static)return;let{yogaNode:o}=e;if(o){if(o.getDisplay()===Aa.DISPLAY_NONE)return;let H=a+o.getComputedLeft(),s=i+o.getComputedTop(),u=c;if(typeof e.internal_transform==="function")u=[e.internal_transform,...c];if(e.nodeName==="ink-text"){let p=rbe(e);if(p.length>0){let $=cU(p),f=jGn(o);if($>f){let I=e.style.textWrap??"wrap";p=lke(p,f,I)}p=Wba(e,p),n.write(H,s,p,{transformers:u})}return}let l=!1;if(e.nodeName==="ink-box"){r3n(H,s,e,n),i3n(H,s,e,n);let p=e.style.overflowX==="hidden"||e.style.overflow==="hidden",$=e.style.overflowY==="hidden"||e.style.overflow==="hidden";if(p||$){let f=p?H+o.getComputedBorder(Aa.EDGE_LEFT):void 0,I=p?H+o.getComputedWidth()-o.getComputedBorder(Aa.EDGE_RIGHT):void 0,b=$?s+o.getComputedBorder(Aa.EDGE_TOP):void 0,L=$?s+o.getComputedHeight()-o.getComputedBorder(Aa.EDGE_BOTTOM):void 0;n.clip({x1:f,x2:I,y1:b,y2:L}),l=!0}}if(e.nodeName==="ink-root"||e.nodeName==="ink-box"){for(let p of e.childNodes)c3n(p,n,{offsetX:H,offsetY:s,transformers:u,skipStaticElements:r});if(l)n.unclip()}}},qZe;var H3n=x(async()=>{Hke();await oU();jqe();await VGn();Vqe();A3n();o3n();qZe=c3n});function Lbe(e){if(!Number.isInteger(e))return!1;return rU(e)===2}var ZZe=x(()=>{qwe()});function Jba(e){if(WZe.has(e))return e;if(zZe.has(e))return zZe.get(e);if(e=e.slice(2),e.includes(";"))e=e[0]+"0";let n=Yr.codes.get(Number.parseInt(e,10));if(n)return Yr.color.ansi(n);return Yr.reset.open}function Kba(e){for(let n=0;n<e.length;n++){let t=e.codePointAt(n);if(t>=Oba&&t<=Rba)return n}return-1}function Yba(e,n){e=e.slice(n,n+19);let t=Kba(e);if(t!==-1){let a=e.indexOf("m",t);if(a===-1)a=e.length;return e.slice(0,a+1)}}function jba(e,n=Number.POSITIVE_INFINITY){let t=[],a=0,i=0;while(a<e.length){let c=e.codePointAt(a);if(Xba.has(c)){let H=Yba(e,a);if(H){t.push({type:"ansi",code:H,endCode:Jba(H)}),a+=H.length;continue}}let r=Lbe(c),o=String.fromCodePoint(c);if(t.push({type:"character",value:o,isFullWidth:r}),a+=o.length,i+=r?2:o.length,i>=n)break}return t}function s3n(e){let n=[];for(let t of e)if(t.code===Yr.reset.open)n=[];else if(WZe.has(t.code))n=n.filter((a)=>a.endCode!==t.code);else n=n.filter((a)=>a.endCode!==t.endCode),n.push(t);return n}function Vba(e){return s3n(e).map(({endCode:a})=>a).reverse().join("")}function XZe(e,n,t){let a=jba(e,t),i=[],c=0,r="",o=!1;for(let H of a){if(t!==void 0&&c>=t)break;if(H.type==="ansi"){if(i.push(H),o)r+=H.code}else{if(!o&&c>=n)o=!0,i=s3n(i),r=i.map(({code:s})=>s).join("");if(o)r+=H.value;c+=H.isFullWidth?2:H.value.length}}return r+=Vba(i),r}var Xba,Oba,Rba,WZe,zZe;var u3n=x(()=>{Lre();ZZe();Xba=new Set([27,155]),Oba="0".codePointAt(0),Rba="9".codePointAt(0),WZe=new Set,zZe=new Map;for(let[e,n]of Yr.codes)WZe.add(Yr.color.ansi(n)),zZe.set(Yr.color.ansi(e),Yr.color.ansi(n))});function iIa(e){return e.replace(tIa,"")}function AIa(e){return nIa.test(e)}function rIa(e,n){let t=0;if(e.length>1){for(let a of e.slice(1))if(a>="＀"&&a<="￯")t+=rU(a.codePointAt(0),n)}return t}function Uke(e,n={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:a=!1}=n,i=e;if(!a)i=AU(i);if(i.length===0)return 0;let c=0,r={ambiguousAsWide:!t};for(let{segment:o}of eIa.segment(i)){if(AIa(o))continue;if(aIa.test(o)){c+=2;continue}let H=iIa(o).codePointAt(0);c+=rU(H,r),c+=rIa(o,r)}return c}var eIa,nIa,tIa,aIa;var l3n=x(()=>{Swe();qwe();eIa=new Intl.Segmenter,nIa=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Mark}|\p{Surrogate})+$/v,tIa=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,aIa=/^\p{RGI_Emoji}$/v});function m3n(e){if(Pke.has(e))return e;if(OZe.has(e))return OZe.get(e);if(e.startsWith(Ske))return oIa;if(e=e.slice(2),e.includes(";"))e=e[0]+"0";let n=Yr.codes.get(parseInt(e,10));if(n)return Yr.color.ansi(n);else return Yr.reset.open}function hbe(e){return e.map((n)=>n.code).join("")}var p3n,Pke,OZe,Ske="\x1B]8;;",RZe,d3n="\x07",EJi,oIa;var Ebe=x(()=>{Lre();p3n=new Set([27,155]),Pke=new Set,OZe=new Map;for(let[e,n]of Yr.codes)Pke.add(Yr.color.ansi(n)),OZe.set(Yr.color.ansi(e),Yr.color.ansi(n));RZe=Ske.split("").map((e)=>e.charCodeAt(0)),EJi=d3n.charCodeAt(0),oIa=\x1B]8;;${d3n}});function JZe(e){return qke([],e)}function qke(e,n){let t=[...e];for(let a of n)if(a.code===Yr.reset.open)t=[];else if(Pke.has(a.code))t=t.filter((i)=>i.endCode!==a.code);else t=t.filter((i)=>i.endCode!==a.endCode),t.push(a);return t}var Zke=x(()=>{Lre();Ebe()});function KZe(e){return JZe(e).reverse().map((n)=>({...n,code:n.endCode}))}var YZe=x(()=>{Zke()});function zke(e,n){let t=new Set(n.map((i)=>i.endCode)),a=new Set(e.map((i)=>i.code));return[...KZe(e.filter((i)=>!t.has(i.endCode))),...n.filter((i)=>!a.has(i.code))]}var jZe=x(()=>{YZe()});function g3n(e){let n=[],t=[];for(let a of e)if(a.type==="ansi")n=qke(n,[a]);else if(a.type==="char")t.push({...a,styles:[...n]});return t}function $3n(e){let n="";for(let t=0;t<e.length;t++){let a=e[t];if(t===0)n+=hbe(a.styles);else n+=hbe(zke(e[t-1].styles,a.styles));if(n+=a.value,t===e.length-1)n+=hbe(zke(a.styles,[]))}return n}var f3n=x(()=>{Ebe();jZe();Zke()});function cIa(e){for(let n=0;n<e.length;n++){let t=e.charCodeAt(n);if(t>=48&&t<=57)return n}return-1}function HIa(e,n){e=e.slice(n);for(let a=1;a<RZe.length;a++)if(e.charCodeAt(a)!==RZe[a])return;let t=e.indexOf("\x07",Ske.length);if(t===-1)return;return e.slice(0,t+1)}function sIa(e,n){e=e.slice(n,n+19);let t=cIa(e);if(t!==-1){let a=e.indexOf("m",t);if(a===-1)a=e.length;return e.slice(0,a+1)}}function b3n(e,n=Number.POSITIVE_INFINITY){let t=[],a=0,i=0;while(a<e.length){let c=e.codePointAt(a);if(p3n.has(c)){let H=HIa(e,a)||sIa(e,a);if(H){t.push({type:"ansi",code:H,endCode:m3n(H)}),a+=H.length;continue}}let r=Lbe(c),o=String.fromCodePoint(c);if(t.push({type:"char",value:o,fullWidth:r}),a+=o.length,i+=r?2:o.length,i>=n)break}return t}var I3n=x(()=>{ZZe();Ebe()});var L3n=x(()=>{Ebe();jZe();Zke();f3n();I3n();YZe()});class Dbe{width;height;operations=[];constructor(e){let{width:n,height:t}=e;this.width=n,this.height=t}write(e,n,t,a){let{transformers:i}=a;if(!t)return;this.operations.push({type:"write",x:e,y:n,text:t,transformers:i})}clip(e){this.operations.push({type:"clip",clip:e})}unclip(){this.operations.push({type:"unclip"})}get(){let e=[];for(let a=0;a<this.height;a++){let i=[];for(let c=0;c<this.width;c++)i.push({type:"char",value:" ",fullWidth:!1,styles:[]});e.push(i)}let n=[];for(let a of this.operations){if(a.type==="clip")n.push(a.clip);if(a.type==="unclip")n.pop();if(a.type==="write"){let{text:i,transformers:c}=a,{x:r,y:o}=a,H=i.split(

SyntaxError: Invalid regular expression flags
at ESMLoader.moduleStrategy (node:internal/modules/esm/translators:117:18)
at ESMLoader.moduleProvider (node:internal/modules/esm/loader:361:14)
at async link (node:internal/modules/esm/module_job:70:21)

Node.js v17.9.1

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

SSH remote OS version: CENT OS Linux 7

Version: 1.7.17 (Universal)
VSCode Version: 1.99.3
Commit: 34881053400013f38e2354f1479c88c9067039a0
Date: 2025-09-29T03:10:26.099Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0

Hey, thanks for the report. This error occurs because you’re using Node.js v17.9.1, which has stricter regex parsing that conflicts with cursor‑agent. cursor‑agent isn’t compatible with Node 17’s changes to regex flag handling.

Also try reinstalling Cursor Shell, since cursor‑agent starts by default.
You can also try a workaround: run the file with this command: cursor editor file_name

Update Node.js to a newer version (18+ ideally 20+) to fix the regex syntax error. Check your version with node --version and update via your package manager or from

Thanks for the quick reply.

My remote server is in CENT OS 7, which wont allow to upgrade node to 18+ version. i tried cursor editor file and reinstalling cursor shell didn’t help.

Thanks,

Ganesh

Hi @Ganesh_B_P, could you try a clean uninstall of the Cursor agent?

To fully remove it, run:

rm -rf ~/.local/bin/cursor-agent ~/.local/share/cursor-agent

Hi Ravi,

I tried it, still getting same error

Any update on this?

With new MAC OS i am not seeing this issue, although issue is not related to local machine, now i can open through bash terminal but when i open it through tmux shell it is throwing this error.

This is critical for me, because i keep on moving from one project to another and need to use tmux to navigate, please provide fix for this.

Hi @Zaria ,

I didnt get any response from yesterday to the above group in telegram

It might be some settings issue for TMUX from the cursor-server, i saw some fixes for vscode similarly there should be for CURSOR, can you please help me in this

i am not getting any support till now

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.